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

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

原文地址:https://www.cnblogs.com/JavCof/p/3190994.html