Why GC does not collect unused objects?

夙愿已清 提交于 2019-12-04 22:00:01

The ConcurrentQueue<T> that is used by default by BlockingCollection<T> contains a memory leak in .Net 4.0. I'm not sure this is the problem you're observing, but it could be.

It should be fixed in the upcoming .Net 4.5.

The Garbage Collector doesn't automatically free memory all the time. You can force garbage collection by calling GC.Collect(); after disposing of unused objects.

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