Inspect ManagedHeap.UsedSize

Hello,

Is there any way to inspect who is using/what is inside the ManagedHeap.UsedSize in the memory inspector??

I have done a test project. Only 1 scene and 1 script.

The script only reserve 1 GB in memory

using UnityEngine;
using System.Collections;

public class MemoryTest : MonoBehaviour {

    public int reserve = 1024;
    byte[] buf;
    // Use this for initialization
    void Start () {

        Reserve(reserve);   
    }

    private void Reserve(int mb)
    {
        byte[] buf = new byte[mb * 1024 * 1024];
   
    }

 
    // Update is called once per frame
    void Update () {
        this.transform.Rotate (Vector3.up * 10.0f * Time.deltaTime);
    }
}

With the Memory Inspector, I can see that actually the 1 gb is reserved (see attachment).
With the memory profiler tool (great tool, by the way), I can not see the 1 gb anywhere.

So the question is, how can I see that MemoryTest class is the class using this memory??

I am asking this because I have a memory leak that I can see in the ManagedHeap.UsedSize, but I have not found any way to inspect the memory that is using each class that is running. Even with external tools. The application runs in Windows.

By the way, I not talking about the garbage that a class could generate, I am talking about the memory that is really using.

Thank you very much


Bumps - we’d like to know this too

Bumping this one.
I’m also experiencing memory leak - hte ManagedHeap.ReservedUnusedSize is always increasing

Bumping up.
My application has same problem. Dont know how to track ManagedHeap.ReservedUnusedSize.

May I join your club please.

Has anyone tried this?>
https://bitbucket.org/Unity-Technologies/memoryprofiler/src/default/