教你50招提升ASP.NET性能(九):显式的使用using语句减少内存泄露
2013-07-15 13:31
405 查看
(15)Reduce memory leaks dramatically with the “using” statement
招数15:
显式的使用using语句减少内存泄露
If a type implements IDisposable, wrap the use of it in a “using” statement, so that it automatically disposes of objects properly when the block exits.
如果一个类实现了IDisposable接口,使用using语句包裹这个类型,以便离开语句块就能自动的释放恰当的对象。
招数15:
显式的使用using语句减少内存泄露
If a type implements IDisposable, wrap the use of it in a “using” statement, so that it automatically disposes of objects properly when the block exits.
如果一个类实现了IDisposable接口,使用using语句包裹这个类型,以便离开语句块就能自动的释放恰当的对象。
相关文章推荐
- 教你50招提升ASP.NET性能(十四):使用startMode属性来减少ASP.NET站点加载时间
- 教你50招提升ASP.NET性能(二十一):避免使用会话状态
- 教你50招提升ASP.NET性能(十):减少通过网络发送的数据
- 教你50招提升ASP.NET性能(三):使用Microsoft的PDBs调试和分析外部的程序集和库
- 教你50招提升ASP.NET性能(八):检查你使用了什么客户端脚本
- 教你50招提升ASP.NET性能(五):确保分页是在数据层完成的
- 使用Jil序列化JSON提升Asp.net web api 性能
- C# ASP.NET 优化程序性能、降低内存使用、提高程序运行速度
- 教你50招提升ASP.NET性能(二十六):对于开发人员的数据库性能技巧
- ASP.NET站点性能提升-减少最后一字节的时间
- ASP.NET站点性能提升-减少长等待时间
- ASP.NET站点性能提升-内存
- 教你50招提升ASP.NET性能(十一):避免在调试模式下运行网站
- 教你50招提升ASP.NET性能(十二):在生产环境,仔细考虑你需要记录哪些日志
- 教你50招提升ASP.NET性能(二十):认识你的循环
- 教你50招提升ASP.NET性能(六):为了生动的用户体验,总是在客户端验证
- 教你50招提升ASP.NET性能(十五):解决性能问题时不要低估UI的价值
- 教你50招提升ASP.NET性能(二十四):ORM小窍门
- 教你50招提升ASP.NET性能(十六):把问题仍给硬件而不是开发人员
- 教你50招提升ASP.NET性能(四):精选的技巧