(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语句包裹这个类型,以便离开语句块就能自动的释放恰当的对象。

教你50招提升ASP.NET性能(九):显式的使用using语句减少内存泄露的更多相关文章

  1. 教你50招提升ASP.NET性能(十六):把问题仍给硬件而不是开发人员

    (27)Throw hardware at the problem, not developers 招数27: 把问题仍给硬件而不是开发人员 As developers, we often want ...

  2. 教你50招提升ASP.NET性能(十四):使用startMode属性来减少ASP.NET站点加载时间

    (25)Use the startMode attribute to reduce the load time for your ASP.NET site 招数25: 使用startMode属性来减少 ...

  3. 教你50招提升ASP.NET性能(二十六):对于开发人员的数据库性能技巧

    Database Performance Tips for Developers对于开发人员的数据库性能技巧 As a developer you may or may not need to go ...

  4. 教你50招提升ASP.NET性能(十一):避免在调试模式下运行网站

    (17)Avoid running sites in debug mode 招数17: 避免在调试模式下运行网站 When it comes to ASP.NET, one of the most c ...

  5. 教你50招提升ASP.NET性能(七):总是在服务器端执行验证

    (13)Always perform validation on the server as well 招数13: 总是在服务器端执行验证 This isn’t exactly a performan ...

  6. 教你50招提升ASP.NET性能(二):移除不用的视图引擎

    (2)Remove unused View Engines 招数2: 移除不用的视图引擎 If you're an ASP.NET MVC developer, you might not know ...

  7. 教你50招提升ASP.NET性能(二十四):ORM小窍门

    ORM TipsORM小窍门 More and more people are using Object to Relational Mapping (ORM) tools to jump the d ...

  8. 教你50招提升ASP.NET性能(二十一):避免使用会话状态

    (39)Avoid using session state 招数39: 避免使用会话状态 Where possible, you should try and avoid using session ...

  9. 教你50招提升ASP.NET性能(二十):7条便利的ViewState技巧

    (32)Seven handy ViewState tips 招数32: 7条便利的ViewState技巧 Every time I have to deal with a classic ASP.N ...

  10. 教你50招提升ASP.NET性能(十九):静态集合

    (30)Static collections 招数30: 静态集合 If a collection is static, make sure it only contains the objects ...

随机推荐

  1. 食物卡喉别拍背部!救了100多万人性命的“海姆立克急救法"

    先讲三个事例: 一.近日,浙江金华一个17月大的小贝边玩边吃花生,被噎住.10多分钟后,奶奶发现小贝大口喘气,以为他玩累了就抱他回家,等父母赶到送医已晚.小贝大脑受损严重-父母含泪同意放弃治疗,孩子走 ...

  2. 【HDOJ】4347 The Closest M Points

    居然是KD解. /* 4347 */ #include <iostream> #include <sstream> #include <string> #inclu ...

  3. Spring个人总结

    编写Spring第一个程序 Spring是一种开源框架,通过使用它可以大大降低企业应用程序的复杂性.Spring是一种非常完善的框架,几乎涉及WEB开发中的每一层,但是在开发中通常使用Spring开发 ...

  4. 通过移动的Mas接口发送短信

    1. 首先,需要移动公司提供的用户名.密码.服务ID.接口Url等信息. 2. 将短信信息整理成XML格式的字符串,再转为byte数组,通过POST的方式,将短信发往Mas接口.需要引用"M ...

  5. RPi 2B python opencv camera demo example

    /************************************************************************************** * RPi 2B pyt ...

  6. NoSql数据库使用半年后在设计上面的一些心得 (转)

    http://www.cnblogs.com/AllenDang/p/3507821.html NoSql数据库这个概念听闻许久了,也陆续看到很多公司和产品都在使用,优缺点似乎都被分析的清清楚楚.但我 ...

  7. 【原】cocos2d-x开发笔记:多点触控

    在项目开发中,我们做的大地图,一个手指头按下滑动可以拖动大地图,两个手指头按下张开或者闭合,可以放大和缩小地图 在实现这个功能的时候,需要使用到cocos2d-x的多点触控功能. 多点触控事件,并不是 ...

  8. HDU 5289 Assignment

    题意:求一段长度为n的序列里有多少个子区间内的最大值减最小值小于k. 解法:RMQ+尺取法或单调队列.RMQ可以用st或者线段树,尺取法以前貌似YY出来过……只是不知道是这个东西…… 设两个标记l和r ...

  9. 无状态、REST、RESTful 和 Web Services【整理】

    在理解 OpenStack 的过程中,常常遇到 REST 这个概念,现从各处搜罗如下: 对 Web Service 的理解: Web 服务有点像对计算机友好的网页,基于让程序可以跨网络交换信息的标准和 ...

  10. Ubuntu 12.04 安装Scrapy爬虫框架

    转自:http://www.cnblogs.com/HelloPython/ 亲测有效 根据Scrapy安装指南(http://doc.scrapy.org/en/latest/intro/insta ...