Curious about memory size from System.GC.GetTotalMemory(false) and Window`s task manager.

Why memory size that Window 7`s task manager showing, differ from size that System.GC.GetTotalMemory(false)?

My project in unity have 3G byte memory from task manager showing. But System.GC.GetTotalMemory(false) show different size, only 250M byte.

Why differ from two size?

GC.GetTotalMemory(false)s size is same as benarchy profiler asset. But not window 7s task manager.

I think that GC.GetTotalMemory will only report the bytes allocated by the scripting engine of Unity.
It does not account for the memory used by the engine itself in native code outside of the scripts.

If you are running inside the editor, then the memory allocated by the engine will be even greater (for all the windows, views, inspector, profiler etc …)

1 Like

Thanks!! My curiosity is solved!