问题描述
你好.
假设我们在安全(由GC管理)代码中有一个实例:Dictionary<Guid, Dictionary<int, SomeClass>> dictionary;
请足够好",
调用dictionary.Clear()
进行重建(重新填充),
还是应该为嵌套项目(不再需要,由new
分配)调用它? :)
外字典条目的计数平均为100,
内部字典的条目数可以超过10000
并且可以随时通过用户的鼠标单击来重建(重新填充)...
...我也应该明确地配置和重建对象吗?
谢谢!
-
/值类型更正/编辑
Hello.
Assumed we have an instance in the safe (managed by GC) code:Dictionary<Guid, Dictionary<int, SomeClass>> dictionary;
Would it be "enough properly", please,
to call the dictionary.Clear()
to rebuild (refill) it,
or it should be called for the nested (no more needed, allocated by new
) items too ? :)
The count of the outer dictionary''s entries averages 100,
the entries'' count of the inner dictionaries can exceed 10000
and it can be rebuilt (refilled) by an user''s mouse click at any time...
...should I dispose and reconstruct the objects explicitly too ?
Thank you !
--
/the value type corrected/edit
推荐答案
这篇关于嵌套词典:内存使用问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!