How can i get the size of the current assembly in memory?
This does the trick for once:
while (System.Diagnostics.Process.GetCurrentProcess().PrivateMemorySize64 < 1 gigabyte)
But its not changing the value even though the assembly is growing in memory.
What am I missing here?
Instead of
PrivateMemorySize64, useWorkingSet64orVirtualMemorySize64, depending on whether you mean ‘currently in memory’ or ‘total memory’.WorkingSet64gives you the number of bytes that are currently in the machine’s RAM.VirtualMemorySize64gives you the number of bytes that are in the process’s address space. This includes bytes currently in RAM as well as bytes swapped out to disk.