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. MMDrawerController 的使用

    1.AppDelegate .h 文件:#import "MMDrawerController .h" @property (strong, nonatomic) MMDrawer ...

  2. 11g RAC集群启动关闭、各种资源检查、配置信息查看汇总。

    简要:一:集群的启动与关闭 1. rac集群的手动启动[root@node1 bin]# ./crsctl start cluster -all2. 查看rac集群的状态[root@node1 bin ...

  3. Python图表绘制:matplotlib绘图库入门

    matplotlib 是Python最著名的绘图库,它提供了一整套和matlab相似的命令API,十分适合交互式地行制图.而且也可以方便地将它作为绘图控件,嵌入GUI应用程序中. 它的文档相当完备,并 ...

  4. 正则匹配<{$vcode}>变量

    $title="<{t}>您的验证码是:<{/t}><{$vcode}>,<{t}>请在注册页输入验证码并完成注册:验证码<{$vcod ...

  5. LeetCode "Design Tic-Tac-Toe"

    We don't have to keep a complete chess board.. just counters! class TicTacToe { vector<int> cn ...

  6. Apache Shiro 使用手册(二)Shiro 认证

    认证就是验证用户身份的过程.在认证过程中,用户需要提交实体信息(Principals)和凭据信息(Credentials)以检验用户是否合法.最常见的"实体/凭证"组合便是&quo ...

  7. pg强制删库

    在某些时候,由于有别的连接,无法删除数据库,这时候用这个 SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity ...

  8. ruby中http请求方法整理

    #POST请求 请求包是json包 返回body并转换成json对象def post_json *args uri = URI.parse args[0] req = Net::HTTP::Post. ...

  9. sql server 相似度对比

    转自:http://www.dotblogs.com.tw/rachen/archive/2008/10/07/5611.aspx 函數一.產生 Like 比對用字串 ) ) ) as begin / ...

  10. 每天一个 Linux 命令(12):more命令

    more命令,功能类似 cat ,cat命令是整个文件的内容从上到下显示在屏幕上. more会以一页一页的显示方便使用者逐页阅读,而最基本的指令就是按空白键(space)就往下一页显示,按 b 键就会 ...