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红色的停止按钮,奇怪的是有小 ...
随机推荐
- Shell 环境变量 & 参数变量
环境变量 $HOME 当前用户的家目录 $PATH 以冒号分隔的用来搜索命令的目录列表 $PS1 命令提示符,通常是$字符,但在bash中,可以使用一些更复杂的值.例如,字符串[\u@\h \w]$就 ...
- hiho一下122周 后缀数组三·重复旋律
后缀数组三·重复旋律3 时间限制:5000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi平时的一大兴趣爱好就是演奏钢琴.我们知道一个音乐旋律被表示为长度为 N 的数构成的数列.小Hi ...
- PHP如何批量生成手机号-使用PHP 如何生成一组不重复的手机号码?
<?php //匹配手机号的正则表达式 #^(13[0-9]|14[47]|15[0-35-9]|17[6-8]|18[0-9])([0-9]{8})$# $arr = array( 130,1 ...
- eclipse平台
eclipse 是一个平台!!!! 能连ssh,能连db,能连windows Eclipse http://www.eclipse.org/downloads/packages/release/Neo ...
- MySql取得日期(前一天、某一天)
在测试一个统计表格,发现每次手写一个地址实在很烦,干脆就搞个自动计算好时间区间的东西.以下内容作为收获吧! 取得当天: SELECT curdate(); mysql> SELECT curda ...
- npm以及gulp相关操作
在工作流相关的第一篇博客中,我们安装了nodejs的环境,那么nodejs自带的npm是一个功能十分强大的管理器,它已经不仅仅是局限于nodejs的版本管理器了,那么当现在我们可以通过npm来下载我们 ...
- C++编程命名规则(转载)
原文地址:http://www.cnblogs.com/ggjucheng/archive/2011/12/15/2289291.html 如果想要有效的管理一个稍微复杂一点的体系,针对其中事物的一套 ...
- S7-1200 与 S7-200 的对比PPT
- java io流 数据流传输
java io流 数据流传输 把这段当公式用就可以了 //数据流传输 import java.io.*; public class Index{ public static void main(Str ...
- 4. read命令
4.1 作用 从标准输入中读取一行. 4.2 参数 -p 允许在read命令行中直接指定一个提示. -t 给用户的输入作限时规定. -n 规定read后变量所接收的字符的个数. -s 使得read命令 ...