Memory Leak and Weak References

£可爱£侵袭症+ 提交于 2019-12-05 19:08:34

Yes, this is a fairly infamous leak in VB.NET assemblies. It is caused by weak references that keep track of events that are declared with the WithEvents keyword. This tracking is done to support Edit and Continue. It leaks one instance of WeakReference for every one WithEvents event declared in a class. The debugger needs to be attached to release those WeakReference objects.

The workaround is simple. Ship the Release build, not the Debug build.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!