1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. Unity 2017.1 beta is now available for download.
    Dismiss Notice
  5. Unity 5.6 is now released.
    Dismiss Notice
  6. Get further faster with the Unity Plus Accelerator Pack, free for new Unity Plus subscribers for a limited time. Click here for more details.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  8. Learn how you'll soon be able to publish your games to China in four simple steps with Xiaomi. Sign up now for early access.
    Dismiss Notice

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:
    441
    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:
    441
    OK i have found a solution. I can get to the details through the profiler providing i do a development build.

    Profiler.usedHeapSize