There is a memory leak issue in current silverlight project.

It occurs in the search function: the memory usage of corresponding IE process increase about 30MB per search, and never get down.

Here is the way I found the bug and fix it:

1. download Windbg from official site:http://www.windbg.org/

2. Dump the heap by the command: !dumpheap -stat -type <my project namespace>

So many objects......

3. copy the object data to a text file with named first_seach.txt.

4. tpye command "g" to keep running. And execute the second search function.

5. Break it, and dump the heap again:  !dumpheap -stat -type <my project namespace>

6. do same operation to get the third heap dump.

7. compare the three txt file, and find the object numbers rule.

8. Luckly, I found my custom data grid object number is the same with the search times. There is the smoking gun.

9. There are dragdrop and contextMenu in this data grid. And both them can cause memory leak:

http://silverlight.codeplex.com/workitem/6206

https://silverlight.codeplex.com/workitem/7089

http://blog.thekieners.com/2010/02/11/simple-weak-event-listener-for-silverlight/

So the drag drop and contextMenu are the bullets.

10. follow the fix: open the source code which is already installed on local machine: C:\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Toolkit\dec11\Source

11. replace the two bad file: ContextMenu.cs and dragdroptarget.cs. I uploaded both the two files here: http://files.cnblogs.com/crazyghostvon/Sourcecode.zip

12. Build to release. The test project will build failed if you didn't copy the testing references (C:\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Toolkit\dec11\Testing\*) to the Binaries folder( C:\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Toolkit\dec11\Source\Source code\Binaries).

13. Replace the framework references (C:\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Toolkit\dec11\Bin)

14. Replace the references of current project, delete it and re-add them all.

15. OK.

SilverLight - Memory Leak的更多相关文章

  1. Android 内存管理 &Memory Leak & OOM 分析

    转载博客:http://blog.csdn.net/vshuang/article/details/39647167 1.Android 进程管理&内存 Android主要应用在嵌入式设备当中 ...

  2. quartz集群报错but has failed to stop it. This is very likely to create a memory leak.

    quartz集群报错but has failed to stop it. This is very likely to create a memory leak. 在一台配置1核2G内存的阿里云服务器 ...

  3. 山东省第七届ACM省赛------Memory Leak

    Memory Leak Time Limit: 2000MS Memory limit: 131072K 题目描述 Memory Leak is a well-known kind of bug in ...

  4. caching redirect views leads to memory leak (Spring 3.1)

    在Spring 3.1以及以下版本使用org.springframework.web.servlet.view.UrlBasedViewResolver + cache(如下配置),在会出现任意种re ...

  5. 一则JVM memory leak解决的过程

    起因是我们的集群应用(3台机器)新版本测试过程中,一般的JVM内存占用 都在1G左右, 但在运行了一段时间后,慢慢升到了4G, 这是一个明显不正常的现象. 定位 过程: 1.先在该机器上按照步骤尝试重 ...

  6. Linux C/C++ Memory Leak Detection Tool

    目录 . 内存使用情况分析 . 内存泄漏(memory leak) . Valgrind使用 1. 内存使用情况分析 0x1: 系统总内存的分析 可以从proc目录下的meminfo文件了解到当前系统 ...

  7. A memory leak issue with WPF Command Binding

    Background In our application, we have a screen which hosts several tabs. In each tab, it contains a ...

  8. quartzScheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak解决

    01-Jul-2016 07:24:20.218 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 80 ...

  9. tomcat 6.0.44 “has failed to stop it. This is very likely to create a memory leak” 问题调查

    1. 问题起因 我们项目中缓存模块某个实现采用了ehcache(2.4.3),当项目部署到tomcat中后,对tomcat做停止服务操作(点击eclipse的console红色的停止按钮,奇怪的是有小 ...

随机推荐

  1. iOS 常用设计模式和机制之 KVC

    KVC 1  key Value Coding,键值编码,是一种间接访问实例变量的方法 2  KVC 提供了一种使用字符串(key)而不是访问器方法,去访问一个对象实例变量的机制 3  KVC 常用方 ...

  2. 2009年到2013年甲子园ED

    2009年 2010年  最喜欢的一个!看过N遍 2011年 也不错! 2012年  超级好听啊~^_^比10年的还好,看过N+1遍……o(╯□╰)o 2013年春季甲子园 2013年夏季 印象最深的 ...

  3. codeforces195c

    link:http://codeforces.com/problemset/problem/336/C 从大到小枚举,如果对应的二进制位不等于0,就加进来,最后的sum如果%2^k==0那么就是合法的 ...

  4. sqlserver sum 和count在关于进行统计时的区别

    sum是对内容的数量进行相加,count 对表行数 对象进行统计 在使用 case 时,如 select subject,count(case when score>80 then score ...

  5. c++类的声明和对象的定义---10

    原创博客:转载请标明出处:http://www.cnblogs.com/zxouxuewei/ 类是创建对象的模板,一个类可以创建多个对象,每个对象都是类类型的一个变量:创建对象的过程也叫类的实例化. ...

  6. jquery选择器之子元素

    HTML代码: :first-child 匹配第一个子元素,每个父元素的第一个子元素 :last-child 匹配最后一个子元素,每个父元素的最后一个子元素 <!DOCTYPE html> ...

  7. knockout 第一个实例visible

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  8. 【python】类中@property使用

    在绑定属性时,如果我们直接把属性暴露出去,虽然写起来很简单,但是,没办法检查参数,导致可以把成绩随便改: s = Student() s.score = 9999 这显然不合逻辑.为了限制score的 ...

  9. python反射的妙用

    反射的简单含义: 通过类名获得类的实例对象 通过方法名得到方法,实现调用 实例: import sys class Webserver(object): def __init__(self,host, ...

  10. JAVA虚拟机类型转换学习

    Java虚拟机包括血多进行基本类型转换工作的操作码,这些执行转换工作的操作码后面没有操作数,转换的值从栈顶端获得.Java虚拟机从栈顶端弹出一个值,对它进行转换,然后再把转换结果压入栈.进行int.l ...