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红色的停止按钮,奇怪的是有小 ...
随机推荐
- mm/vmalloc.c
/* * linux/mm/vmalloc.c * * Copyright (C) 1993 Linus Torvalds */ #include <asm/system.h>#in ...
- ural 1057Amount of Degrees ——数位DP
link:http://acm.timus.ru/problem.aspx?space=1&num=1057 论文: 浅谈数位类统计问题 刘聪 #include <iostream&g ...
- linux下oracle 10g的sqlplus无法使用
问题如标题所示. 解决办法, 1,root用户登录,建立软连接 cd / cd /usr/bin ln -s /home/oracle/product/10.2.0/db_1/bin/sqlplus ...
- PHP curl传 json字符串
$ch = curl_init(); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_seto ...
- 如果在代码中使用JS
protected void Page_Load(object sender, EventArgs e) { //获得.js文件 string myscript = ...
- CSS 知识点
1:display:block:比较常用于<a><span>这两个标签——因为这两个标签非块元素,如果不用display:block定义一下,因为a标签没有结构,就是没有宽高, ...
- docker swarm
1.docker pull swarm 2.docker run --rm swarm create #创建cluster id b1442105f281c7eaa31f8e5d815fe0e2 3. ...
- Docker之功能汇总
Docker-给容器做端口映射 基本的命令是 -P(大写) :Docker 会随机映射一个 49000~49900 的端口到内部容器开放的网络端口基本的命令是 -p(小写) :Docker则可以指定要 ...
- CSS 派生选择器
派生选择器 通过依据元素在其位置的上下文关系来定义样式,你可以使标记更加简洁. 在 CSS1 中,通过这种方式来应用规则的选择器被称为上下文选择器 (contextual selectors),这是由 ...
- 使用WebView加载assets下的html文件
有时候,我们需要将html文件以及所用到的图片都放在 assets/html/ 目录下.然后在页面上通过WebView来显示出来,比如给页面一个默认的显示,这样子看起来效果要好很多.代码如下: pri ...