SilverLight - Memory Leak
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的更多相关文章
- Android 内存管理 &Memory Leak & OOM 分析
转载博客:http://blog.csdn.net/vshuang/article/details/39647167 1.Android 进程管理&内存 Android主要应用在嵌入式设备当中 ...
- 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内存的阿里云服务器 ...
- 山东省第七届ACM省赛------Memory Leak
Memory Leak Time Limit: 2000MS Memory limit: 131072K 题目描述 Memory Leak is a well-known kind of bug in ...
- caching redirect views leads to memory leak (Spring 3.1)
在Spring 3.1以及以下版本使用org.springframework.web.servlet.view.UrlBasedViewResolver + cache(如下配置),在会出现任意种re ...
- 一则JVM memory leak解决的过程
起因是我们的集群应用(3台机器)新版本测试过程中,一般的JVM内存占用 都在1G左右, 但在运行了一段时间后,慢慢升到了4G, 这是一个明显不正常的现象. 定位 过程: 1.先在该机器上按照步骤尝试重 ...
- Linux C/C++ Memory Leak Detection Tool
目录 . 内存使用情况分析 . 内存泄漏(memory leak) . Valgrind使用 1. 内存使用情况分析 0x1: 系统总内存的分析 可以从proc目录下的meminfo文件了解到当前系统 ...
- 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 ...
- 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 ...
- 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红色的停止按钮,奇怪的是有小 ...
随机推荐
- ajax data数据里面传一个json到后台的写法
$.ajax({ url:url+"/crm/contact", type:'PUT', ...
- Linux之Qt利用Sqlite静态编译库(转)
参考:http://www.linuxidc.com/Linux/2011-11/47465.htm sqlite3编译安装 ------------------------arm版--------- ...
- ZFS(一):ZFS在Debian GNU/Linux上的安装
以下内容翻译自https://pthree.org/2012/04/17/install-zfs-on-debian-gnulinux/,并附有原文,由于是第一次翻译,如有任何翻译不恰当之处,欢迎指出 ...
- vb6 获取 http only 的 Cookie
Option Explicit ' No more data is available. ' The data area passed to a system call is too small. P ...
- MapReduce的输入输出
mapper和reducer的划分 mapper的数量等于输入文件被划分成的分块数,这取决于输入文件的大小以及文件块的大小.一个map操作只处理一个输入分片.运行作业的客户端通过调用getSplits ...
- VS xsd Class
1.将xsd 文件 转成 实体文件 xsd FilePath(*.xsd) /c 2.将 xml 文件 转成 xsd 文件 xsd FilePath(*.xml)
- ACM_ICPC hdu-2111(简单贪心算法)
一道非常简单的贪心算法,但是要注意输入的价值是单位体积的价值,并不是这个物品的总价值!#include <iostream> #include <stdio.h> #inclu ...
- 如何成为一名合格甚至优秀的个人草根站长(转载自ChinaZ)
这章本来不想写来的,后来琢磨琢磨还是废话一下吧.主要是想说下现在草根站长的状态和如何成为一名合格的甚至优秀的草站站长. 伟大的草根站长们,在某些媒体的超级忽悠下全来到网络上淘金来了,有在校的大学生,有 ...
- java短信接口
一.背景 从是Java一直想做一个跟生活联系特别紧密的东西,比如短信.邮箱.电话什么的一直是我感兴趣的,可是楞是当初没有头绪弄,恰巧今天公司在做一个 webrtc的视频会议的软件,刚好有短信这个需求, ...
- 显示hello
The modern user interface is constructed from visual objects of various sorts. Depending on the oper ...