Silverlight内存泄漏(Silverlight Memory Leak)
我一直在努力解决这个问题,我真的找不到解决方案。 我已经检查了所有标准的内存泄漏问题,例如PageActivity,DataTemplates等,它就是这样。 我正在使用windbg和!GCRoot我得到:
DOMAIN(097C9970):HANDLE(固定):52412f8:Root:0ade4260(System.Object []) - >
09deab28(System.Collections.Generic.List`1 [[System.Object,mscorlib]]) - >
0a3a8708(System.Object的[]) - >
0a42becc(System.Windows.Shapes.Rectangle) - >
0a4267e4(System.Windows.Controls.Grid) - >
0a40da84(System.Windows.Controls.Primitives.CalendarDayButton) - >
0a3cc8e8(System.Windows.Controls.Calendar) - >
0a3ccd44(System.Windows.Input.MouseButtonEventHandler) - >
0a3cc828(System.Windows.Controls.DatePicker) - >
0a3cd594(System.Windows.Controls.StackPanel) - >
0a3cd690(System.Windows.Controls.StackPanel) - >
0a3cfcd0(System.Windows.Controls.StackPanel) - >
0a3cfdcc(System.Windows.Controls.Border) - >
0a3e11f0(System.Windows.Controls.ContentPresenter) - >
0a3e00d0(System.Windows.Controls.ContentControl) - >
0a3dffd4(System.Windows.Controls.Grid) - >
0a3e02d0(System.Windows.Controls.Border) - >
0a3de464(System.Windows.Controls.Grid) - >
0a3cc160(System.Windows.Controls.Expander) - >
0a3cc0b8(System.Windows.Controls.StackPanel) - >
0a3d4078(System.Windows.Controls.Grid) - >
0a3d4174(System.Windows.Controls.StackPanel) - >
0a3d4f90(System.Windows.Controls.ContentPresenter) - >
0a3d6398(System.Windows.Controls.ContentPresenter) - >
0a3d4ff4(System.Windows.Controls.ContentControl) - >
0a3d51e4(System.Windows.Controls.Grid) - >
0a3cadd4(System.Windows.Controls.Activity) - >
0a3caa4c(System.Windows.Controls.Grid) - >
0a3ca310(EMSOLG.Registration.StudentPayDetails)有什么方法可以找到更详细的漏洞在哪里?
当我更改组合框的选定值时会发生这种情况
<ComboBox x:Name="cmbPaymentMethod" Height="23" Background="LightYellow" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding intPaymentMethod,Mode=TwoWay}" SelectionChanged="cmbPaymentMethod_SelectionChanged" />
该活动的代码是:
PageActivity.IsActive = true; tblAppForm thisApplication = (tblAppForm)this.DataContext; thisApplication.curInvoiceAmount = 0; RG.Amount = ; thisApplication.curRecovery = 0; txtInvoiceTotal.Text = "0.00";
卸载控件后,我尝试设置
DataContext = null;
以及我认为可能导致泄漏的许多其他控件和变量I've been struggling with this for a while now and I really can't find a solution. I've checked all the standard memory leak issues i.e. PageActivity, DataTemplates etc. and it's nothing like that. I am using windbg and with !GCRoot I get:
DOMAIN(097C9970):HANDLE(Pinned):52412f8:Root: 0ade4260(System.Object[])->
09deab28(System.Collections.Generic.List`1[[System.Object, mscorlib]])->
0a3a8708(System.Object[])->
0a42becc(System.Windows.Shapes.Rectangle)->
0a4267e4(System.Windows.Controls.Grid)->
0a40da84(System.Windows.Controls.Primitives.CalendarDayButton)->
0a3cc8e8(System.Windows.Controls.Calendar)->
0a3ccd44(System.Windows.Input.MouseButtonEventHandler)->
0a3cc828(System.Windows.Controls.DatePicker)->
0a3cd594(System.Windows.Controls.StackPanel)->
0a3cd690(System.Windows.Controls.StackPanel)->
0a3cfcd0(System.Windows.Controls.StackPanel)->
0a3cfdcc(System.Windows.Controls.Border)->
0a3e11f0(System.Windows.Controls.ContentPresenter)->
0a3e00d0(System.Windows.Controls.ContentControl)->
0a3dffd4(System.Windows.Controls.Grid)->
0a3e02d0(System.Windows.Controls.Border)->
0a3de464(System.Windows.Controls.Grid)->
0a3cc160(System.Windows.Controls.Expander)->
0a3cc0b8(System.Windows.Controls.StackPanel)->
0a3d4078(System.Windows.Controls.Grid)->
0a3d4174(System.Windows.Controls.StackPanel)->
0a3d4f90(System.Windows.Controls.ContentPresenter)->
0a3d6398(System.Windows.Controls.ContentPresenter)->
0a3d4ff4(System.Windows.Controls.ContentControl)->
0a3d51e4(System.Windows.Controls.Grid)->
0a3cadd4(System.Windows.Controls.Activity)->
0a3caa4c(System.Windows.Controls.Grid)->
0a3ca310(EMSOLG.Registration.StudentPayDetails)Is there any way I can find out with more detail where is the leak?
It happens when I change the selected value of the combobox
<ComboBox x:Name="cmbPaymentMethod" Height="23" Background="LightYellow" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding intPaymentMethod,Mode=TwoWay}" SelectionChanged="cmbPaymentMethod_SelectionChanged" />
The Code behing for the event is:
PageActivity.IsActive = true; tblAppForm thisApplication = (tblAppForm)this.DataContext; thisApplication.curInvoiceAmount = 0; RG.Amount = ; thisApplication.curRecovery = 0; txtInvoiceTotal.Text = "0.00";
When the control is unloaded I've tried setting the
DataContext = null;
as well as a host of other controls and variables that I thought might cause the leak
原文:https://stackoverflow.com/questions/4850306
最满意答案
这不是实现此功能的正确方法,自动完成灯将为下一个属性提供信息,因为他们已经编写了Django自动完成光文档
This is not the correct way to implement this functionality, autocomplete light will provide information as a forward for the next attribute as they have written Django auto complete light documentation
相关问答
更多-
我自己修好了。 问题与PYTHONPATH或我上面所说的任何事情无关。 问题在于Aptana! 我还注意到现在可用于Windows x86的Aptana是3.4.2而不是之前安装的3.5。 我认为他们已经注意到3.5中存在错误,现在提供3.4.2版本。 要解决这个问题,只需重新安装Aptana即可。 注意:如果您收到“未绑定端口(找到端口-1)。是否启用了防火墙?” 输入一些文本并尝试[Ctrl + Space]后,您可能会遇到同样的问题。 希望对你有所帮助。 I fixed this myself. Th ...
-
所以我在页面上只有一个自动完成小部件,只选择了一个项目。 此代码取消选择该项: var widget = $('.autocomplete-light-widget').yourlabsWidget(); var choice = $('span.div.hilight'); widget.deselectChoice(choice); So I have only one auto-complete widget on a page and only one item is selected. This ...
-
对于ModelForm你应该使用 class Meta: exclude = ( 'name', 'somefield', 'someotherfield', ) 如果您不希望将该模型字段传递给表单。 您可以包含不应该转到此元组中的表单的任何其他字段。 否则,表单期望用户无论如何都应该为theese字段提供值。 你在什么时候收到你的错误以及什么是潜在的Diagnosis模型也不是很清楚。 For ModelForm you shoul ...
-
FieldError at / autocomplete / ItemsAutocomplete /(FieldError at /autocomplete/ItemsAutocomplete/)[2023-05-21]
你忘记了一个逗号! 更改 search_fields=('item_name') 至 search_fields=('item_name',) search_fields应该是一个可迭代的,所以如果它有值('item_name') (这是一个字符串),它将得到'i','t','e'等(这就是你得到消息的原因Cannot resolve keyword u'i' into field ) 此外,模型名称存在一些严重问题:我看到您有一个名为Items的模型和一个名为Ca_dispensaries_item的模型 ... -
Django-autocomplete-light如何从html中获取数据?(Django-autocomplete-light how to get data from html?)[2024-01-12]
自动完成灯具有一个名为widget.html的模板,该模板在模板中呈现: ... {% block select %} {# a hidden select, that contains the actual selected values #} -
最后我解决了将以下代码添加到models.py的问题 from south.modelsinspector import add_ignored_fields add_ignored_fields(["^taggit_autocomplete\.managers"]) Finally I have solved the problem adding following code to models.py from south.modelsinspector import add_ignored_field ...
-
好吧,也许,没有比覆盖choices_for_request方法更好的解决方案。 Ok, maybe, there is no better solution than overriding choices_for_request method.
-
这不是实现此功能的正确方法,自动完成灯将为下一个属性提供信息,因为他们已经编写了Django自动完成光文档 This is not the correct way to implement this functionality, autocomplete light will provide information as a forward for the next attribute as they have written Django auto complete light documentation ...
-
django-filter with django autocomplete-light(django-filter with django autocomplete-light)[2021-09-08]
过滤器只是常规Django表单字段之上的抽象。 任何不适用于过滤器的参数都将传递给基础字段。 在这种情况下,您需要做的就是将自动完成小部件与过滤器连接起来。 可能类似于: devname_url = '...' class DevListFil(django_filters.FilterSet): devname = django_filters.CharFilter(name='devname', lookup_expr='icontains', widget=autocomplete.Mode ... -
您几乎不应该将views导入forms 。 表单用于视图,反之亦然。 我将autocomplete = AutocompleteView('Gestion')到一些单独的模块(例如, gestion.autocomplete )并从那里导入。 PS另请注意,Python中的模块以小写形式命名,因此它应该是gestion ,而不是Gestion You should almost never import views into forms. Forms are used in views, not vice ...