Search Unity

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

Discussion in 'Scripting' started by karljj1, Apr 2, 2012.

  1. karljj1

    karljj1

    Joined:
    Feb 17, 2011
    Posts:
    440
    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
     
  2. karljj1

    karljj1

    Joined:
    Feb 17, 2011
    Posts:
    440
    OK i have found a solution. I can get to the details through the profiler providing i do a development build.

    Profiler.usedHeapSize