非托管资源泄露
来源:互联网 发布:炮王 知乎 编辑:程序博客网 时间:2024/06/01 10:15
2013/08/07
现象:
RSS信息播放库运行两天后出现“内存不足”现象
BUG:
Exception:内存不足。
System.OutOfMemoryException
Stack Trace:
在 System.Drawing.Graphics.CheckErrorStatus(Int32 status)
在 System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y, Int32 width, Int32 height)
在 System.Drawing.Bitmap..ctor(Image original, Int32 width, Int32 height)
在 System.Drawing.Bitmap..ctor(Image original)
在 Nova.Rss.RssToImage.RssItemAsImg(RssItemInfo item, Int32 wndWidth, Bitmap& bmp)
在 Nova.Rss.RssToImage.RssToMultiLinesImage(RssInfo rssInfo, Int32 wndWidth, Color backColor, List`1& imgList)
在 Nova.Rss.RssToImage.RssToScreenImageIgnoreHalfWord(RssInfo rssInfo, Size wndSize, Int32 leftMargin, Color backColor, List`1& imgList)
解决过程:
使用工具:.Net Memory Profiler工具运行库,逐个接口查看内存泄漏变量及源。
资料:
http://msdn.microsoft.com/zh-cn/magazine/cc163491.aspx
结论:
对于非托管资源,要非常注意资源的释放,容易产生内存泄漏的类型有:网络连接类,文件操作类,GDI+,流,COM组件等。
0 0
- 非托管资源泄露
- 非托管资源内存泄露调测
- 托管资源非托管资源
- 托管和非托管资源
- C#非托管资源
- 清理非托管资源
- 非托管资源
- C#非托管资源
- 托管资源和非托管资源
- .net托管资源和非托管资源
- net托管资源和非托管资源
- net托管资源和非托管资源
- 托管资源和非托管资源
- .NET 托管资源与非托管资源
- 托管资源和非托管资源
- C# 托管资源和非托管资源
- c# 托管资源和非托管资源
- 托管资源和非托管资源
- 基本环境搭建
- 软件开发 注释习惯重要性
- iOS入门编程1--iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- NOIP 数字反转
- 高人对libsvm的经典总结
- 非托管资源泄露
- Codeforces 427D Match & Catch(后缀自动机)
- Linux 给用户及用户组分配权限以及对文件目录的操作
- [hadoop2.7.1]I/O之SequenceFile最新API编程实例(写入、读取)
- Xcode快捷键
- hdu--4455+ Substrings+2012杭州区域赛C题+DP
- Swift-- 方法
- [TwistedFate]属性property
- zoj 3891 K-hash(后缀自动机)