- Home /
ManagedHeap.ReservedUnusedSize
Hi guys, can someone explain to me what the "ManagedHeap.ReservedUnusedSize" is in the profiler? That entry starts at around 200kb when I start my game, but it goes up to even 20mb at times. It may be worth saying that I am loading a pretty big text file, however I am destroying it after I am done with it. That alone is about 6mb worth of data. Should I be calling GC.Collect after that?
Also the "ManagedHeap.UsedSize" increases and doesn't go down either.
Any ideas?
The memory used by $$anonymous$$ono only increases, it will never decrease, since this memory is not returned to the OS.
Hm.. so I cannot free this memory? Is this intended behaviour?
"The memory used by $$anonymous$$ono only increases, it will never decrease, since this memory is not returned to the OS." ^^ This is not correct. $$anonymous$$ono(/Unity) does return blocks of unused memory to the operating system.
That makes more sense. But how can I free this memory? I do clear all the references I find, however it's still reporting as "ReservedUnusedSize". Surely if it's unused I can claim it back.
The GC deter$$anonymous$$es whether a block can be freed - the best you can do is to be careful what/when you allocate, and then make sure you don't keep references to things you don't care about any more.
Your answer
Follow this Question
Related Questions
Performance going down over time 2 Answers
Online, Possible Memory Leaks with RPC 0 Answers
CPU being choked by GC.MarkDependencies 1 Answer
Profiler spikes 1 Answer