Hi,
I have a fewSortedList<>
andSortedDictionary<>
structures in my simulation code and I add millions of items in them over time. The problem is that the garbage collector does not deallocate quickly enough memory so there is a huge hit on the application's performance. My last option was to engage theGC.Collect()
method so that I can reclaim that memory back. Has anyone got a different idea? I am aware of theFlyweight
pattern which is another option but I would appreciate other suggestions that would not require huge refactoring of my code.