01 2019 档案
摘要:Event handlers leak This type of leak occurs when subscribing an object (let's call it listener) to an event of some other object (let's call it sourc
阅读全文
摘要:public class MyClass : IDisposable { #region 变量声明 // 指向外部非托管资源 private IntPtr handle; // 此类使用的其它托管资源. private Component Components; // 跟踪是否调用.D...
阅读全文
摘要:1.GC只能回收堆里的托管资源 2.GC 回收,"代"的概念 .net 托管资源分三代,代数越大 资源的生命周期越长. 0 代 和1代的资源比较少可以比较频率的回收, 回收2代以上差不多等于对整个应用程序的堆进行遍历了,比较不适合频繁的回收. GC.Collection() 对所有代的资源进行遍历
阅读全文