Is ConcurrentBag cause of memory leak? [duplicate]

痴心易碎 提交于 2019-12-06 00:53:05
Polity

This is because a concurrent bag adds items to the local storage of a thread. The reference from the local storage of a thread to the bag is a strong reference so as long as there is still 1 item in the bag, it ensures that at least 1 thread references the Bag and it wont be collected. Consume all items from the bag or use a different container.

Please see: Possible memoryleak in ConcurrentBag?

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