How Can I Find Out How Much Memory Unity Is Using?

Hi,

I want to determine how much memory Unity is using at runtime so i know if it is safe to load in more data or stop and wait for memory to become free. This needs to be an automated process so i cant use the profiler.

I have tried Process.GetCurrentProcess().PrivateMemorySize64 but it is allways 0. It seems mono does not support this.
I even tried building a .Net DLL to do the query but i still get 0.

Does anyone know a way around this?

Thanks

Karl

OK i have found a solution. I can get to the details through the profiler providing i do a development build.

Profiler.usedHeapSize