Event handlers leak

This type of leak occurs when subscribing an object (let's call it listener) to an event of some other object (let's call it source). For example: Timer1.Tick += OnTimer; During subscription, the source object gets a reference to the event handler of the listener object. If you delete the listener, this reference will prevent it from being garbage collected. dotMemory automatically finds objects that are referenced in event handlers but are never unsubscribed from corresponding events.

Wpf binding leak

Breaking WPF data binding patterns also can cause a memory leak. After you perform data binding to some property of a source object, the binding target object starts to listen for property change notifications. If the property is not aDependencyProperty object and the target object does not implement the INotifyPropertyChanged interface, a memory leak in source object and in every object to which source object refers may occur. dotMemory detects such binding pattern violations and shows you the list of objects that may potentially cause this leak type.

The leak will not take place in case the OneTime binding mode is used to update the target.

Wpf collection binding leak

This leak is similar to the WPF binding leak described above. If there is binding to a collection that does not implement the INotifyCollectionChanged interface, WPF creates a strong reference to this collection. As a result, it stays in memory for the entire application lifetime. dotMemory detects and shows you such objects.

Dependency property leak

This leak occurs due to quite the same reasons as the event handlers leak. GC will not collect objects subscribed onDependencyProperty changes through the AddValueChanged method until they are unsubscribed using the RemoveValueChanged method. dotMemory detects and shows you all such A objects.

x:Name WPF leak

This leak takes place because of the following WPF peculiarity: WPF creates a strong global reference to the UI element that is declared in XAML and uses the x:Name directive. For example:< XNameTest:UserControl1 Grid.Row="0" x:Name="myControl1"/> Thus, if you dynamically remove the element declared in such a way, it will still be in memory.

最新文章

  1. swift项目导入OC框架
  2. Momentics创建Photon图形程序
  3. Form表单中method为get和post的区别
  4. 初始化httpclient的几种方式
  5. swift中文文档- 类型转换
  6. jar转dll
  7. Javascript 5种方法实现过滤删除前后所有空格
  8. Ubuntu15.04 + Matlab2014a + MatConvNet install and compile
  9. Emacs Org-mode 4 超连接
  10. mysql mycat 中间件安装与使用
  11. 监控服务器配置(四)-----OracleDb_exporter安装配置
  12. 【bzoj1901】dynamic ranking(带修改主席树/树套树)
  13. 执行SDK的aapt报错./aapt: /lib64/libc.so.6: version `GLIBC_2.14&#39; not found (required by ./aapt)
  14. shell 基本操作小结
  15. python获取文件属性
  16. 怎么查看eclipse是否支持maven
  17. C语言的谜题
  18. 表格 滚动条 (tbody部分滚动)
  19. jQuery中 $.extend 和 $.fn.extend 作用及区别
  20. JSP和Servlet中的几个编码的作用及原理

热门文章

  1. 使用Nexus搭建Maven仓库
  2. [Angular] ChangeDetection -- onPush
  3. 【Linux】Linux下配置apache - 安装文件夹具体解释
  4. php的标准输入与输出是什么?
  5. 手机端自适应布局demo
  6. epoll 和select
  7. 使用jsp,tomcat实现用户登录注册留言的代码
  8. 再续FPGA初心,京微齐力脱胎京微雅格重新起航(700万元天使轮,泰有基金领投,水木基金、臻云创投、泰科源跟投。数千万元Pre-A轮融资,领投方为海康基金)
  9. Java冒泡排序与二分法查找的代码随笔
  10. 使用Akka、Kafka和ElasticSearch等构建分析引擎 -- good