c# - Why calling GC.Collect() multiple times free some memory that usually isn't cleaned? -
i found out weird thing in gc, when have application removed reference many large objects, still eats lot of ram, in case around 300mb. memory not cleaned if call gc.collect()
then tried randomly call 10 times in few seconds, , result: 200mb of ram freed resulting in application eating 100mb instead of 300mb of private ram (not virtual physical / resident ram)
why this? how can make gc clean memory automatically without having call hand?
either:
you still holding onto reference large object somewhere, calling
gc.collect
can't clean up.there unmanaged memory accounts majority of memory consumed. not disposing of unmanaged resource.
Comments
Post a Comment