Memory leak with large amount of persistent data

Hey guys, has anyone gotten memory leak errors when allocating large amounts of persistent data? I figured it was because I’m reserving about 1Gig in native collections for my map data.

Whenever the map is unloaded I eventually dispose of it…

    // inside the map gameobject
    void OnDestroy()
    {
        _.Cleanup();
    }

    // and this is inside my manager class
    public void Cleanup()
    {
        map.nodes.Dispose();
        map.details.Dispose();
        map.grid.Dispose();

        foreach(KeyValuePair<int3, Chunk> i in map.chunks) {
            i.Value.register.Dispose();
            i.Value.highlighter.Dispose();
        }
    }

The leak message.

Found 5075 leak(s) from callstack:
0x00000205b3834c73 (Mono JIT Code) Unity.Collections.Memory/Unmanaged/Array:Resize (void*,long,long,Unity.Collections.AllocatorManager/AllocatorHandle,long,int) (at ./Library/PackageCache/com.unity.collections@2.5.1/Unity.Collections/Memory.cs:79)
0x00000205b3834b33 (Mono JIT Code) Unity.Collections.Memory/Unmanaged:Allocate (long,int,Unity.Collections.AllocatorManager/AllocatorHandle) (at ./Library/PackageCache/com.unity.collections@2.5.1/Unity.Collections/Memory.cs:20)
0x00000205b3838ad3 (Mono JIT Code) Unity.Collections.LowLevel.Unsafe.UnsafeParallelHashMapData:AllocateHashMap<int, int> (int,int,Unity.Collections.AllocatorManager/AllocatorHandle,Unity.Collections.LowLevel.Unsafe.UnsafeParallelHashMapData*&) (at ./Library/PackageCache/com.unity.collections@2.5.1/Unity.Collections/UnsafeParallelHashMap.cs:135)

It seems to be coming from my chunk class.

    // CONSTRUCTOR:  initializes all of our node lists
    public Chunk(int x, int y, int z)
    {
        int capacity = (_.game.map.scale * _.game.map.scale * _.game.map.scale);
        register = new NativeParallelHashMap<int, int>(capacity, Allocator.Persistent);
        highlighter = new NativeParallelHashMap<int, int3>(capacity, Allocator.Persistent);
        position = new(x,y,z);
        loaded = false;
        busy = false;
    }

Everything seems fine so I’m guessing the leak warning is a false positive? Is it because I’m calling the Dispose inside a foreach?

Run the same code with just one chunk. This will make it easier to debug.

Also consider your data types. Does it have to be int? If 65k values suffice you can do away with short/ushort and slash mem usage in half. Also consider offsetting chunk positions because you may even only need to use byte to span a chunk with 256x256x256 dimension. Position is chunk position plus grid position within chunk. Suddenly you only use a quarter of the memory.

Thanks for reply CodeSmile. I ran it with one chunk and only 100 nodes and the memory leak allocations it was saying matched up with this part.

    // CONSTRUCTOR:  initializes all of our node lists
    public Chunk(int x, int y, int z)
    {
        int capacity = (_.game.map.scale * _.game.map.scale * _.game.map.scale);
        register = new NativeParallelHashMap<int, int>(capacity, Allocator.Persistent);
        highlighter = new NativeParallelHashMap<int, int3>(capacity, Allocator.Persistent);
        position = new(x,y,z);
        loaded = false;
        busy = false;
    }

So I’m pretty sure that the compiler just cannot find where I am disposing those allocations (I’m doing it in my manager class whenever the map gets changed). I’ll just ignore it I guess. We can’t expect the compiler to have AI lvl thinking.

Oh my goodness, I hope THAT never happens!

AI is a random unpredictable thinking disaster.

Compilers are very predictable and we like them that way.

All that said, maybe you found an allocator bug… as CSmile suggests, strip it down to the barest, prove the error, and if so, report it via Help → Report A Bug.

Leak detection is managed by allocators which track active allocations at runtime, not the compiler. As a sanity check, you can test any code for unmanaged allocator leaks by doing:

UnsafeUtility.ForgiveLeaks();
// create some resource, do things, dispose it
UnsafeUtility.CheckForLeaks();

CheckForLeaks returns the number of leaks detected, and an error is logged to the Console if leaks are found. If you’re on the latest version of the editor for the release stream, it would be most helpful to share a full, runnable code example that reproduces this leak.

Your post is tagged as 6 Preview, but all such releases use simplified PackageCache paths without the version. Which exact version of the Unity editor are you using here? Editor releases come with fixes. For example, 2022.3.12f1 which fixed leak detection for allocations on worker threads.

1 Like

No, no, no! You cannot just ignore an issue that is potentially disastrous. :wink:

Try to find more information. For instance the memory profiler, and for a second opinion also have an eye on what Task Manager is reporting. If the memory usage keeps increasing over time, your game will crash eventually.

Be sure to upgrade to the latest patch release version (6000.0.21f1) and also update relevant packages. In case this is a known and fixed issue.

Kurt already pointed that out. I also want to stress that what we call “AI” is and erroneous algorithm. It’s tantamount to comparing PNG (lossless) with JPG (lossy compression), where the compiler is PNG and the AI is JPG. At some level, you will get mangled, misleading, if not downright incorrect results from an AI. If the compiler does any of that, we call that a compiler bug. :wink:

The AI we have trained thus far is also a major cargo cult enforcer, at least in some areas. It tends to favor the common, most frequently used solutions rather than the “good ones” unless a human being with enough expertise in the area will manually educate the AI towards producing better results, typically by selecting better training input over the most frequently used input.

2 Likes

Hey thanks for replies guys.

@Kurt-Dekker - I hope not. It’s more likely I’m just doing something stupid lol.

@Spy-Master - I’m on LTS 2022.3.37f1. I created a new project with a very simple example of how I am building a map but I still get the warnings there. Can I zip up the project and upload it here? I’ll keep messing around with it but I just don’t have any idea what it could be at this point.

I’ll go ahead and upload the code in case anyone sees something stupid.

public class _Editor : MonoBehaviour
{
    void Awake() { UnsafeUtility.ForgiveLeaks(); }

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.O)) {
            Game g = new Game(); 
            g.map = new Map(10, 10, 10);
            g.map.Setup();

            _.game = g;
            _.game.map.Build();
        }

        if (Input.GetKeyDown(KeyCode.P)) { 
            _.Cleanup();
            UnsafeUtility.CheckForLeaks(); 
        }
    }
}

public static class _
{
    public static Game game;

    public static void Cleanup()
    {
        _.game.Cleanup();
    }
}

[Serializable]

public class Game
{
    public Map map;

    public void Cleanup()
    {
        map.nodes.Dispose();
        map.details.Dispose();
        map.grid.Dispose();

        foreach(KeyValuePair<int3, Chunk> i in map.chunks) {
            i.Value.register.Dispose();
            i.Value.highlighter.Dispose();
        }
    }
}

[Serializable]

public class Map
{
    public int size;
    public int height;
    public int scale;
    public int capacity;
    public NativeParallelHashMap<int, Node> nodes;
    public NativeParallelHashMap<int, Detail> details;
    [NonSerialized] public NativeParallelMultiHashMap<int3, int> grid;
    [NonSerialized] public Dictionary<int3, Chunk> chunks;

    public Map(int size, int height, int scale)
    {
        this.size = size;
        this.height = height;
        this.scale = scale;
        capacity = size * size * height * scale * scale * scale;
        nodes = new NativeParallelHashMap<int, Node>(capacity, Allocator.Persistent);
        details = new NativeParallelHashMap<int, Detail>(capacity, Allocator.Persistent);
    }

    public void Setup() 
    {
        grid = new NativeParallelMultiHashMap<int3, int>(capacity, Allocator.Persistent);
        chunks = new Dictionary<int3, Chunk>();
    }

    public void Build() 
    {
        for(int x = 0; x < size; x++) {
            for(int y = 0; y < height; y++) {
                for(int z = 0; z < size; z++) {
                    Chunk chunk = new Chunk(x * scale, y * scale, z * scale);
                    chunks.Add(chunk.position, chunk);
                }
            }
        }
    }
}

public class Chunk
{
    public int3 position;
    public NativeParallelHashMap<int, int> register;
    public NativeParallelHashMap<int, int3> highlighter;

    public Chunk(int x, int y, int z)
    {
        int capacity = (_.game.map.scale * _.game.map.scale * _.game.map.scale);
        register = new NativeParallelHashMap<int, int>(capacity, Allocator.Persistent);
        highlighter = new NativeParallelHashMap<int, int3>(capacity, Allocator.Persistent);
        position = new(x,y,z);
    }
}

[Serializable]

public struct Node
{
    public int ID;
    public bool stationary;
    public int type;
    public int mask;
    public int3 position;
}

With that code, one potential issue I see is creating the game/map multiple times and failing to dispose one that already exists. Basically pressing O multiple times before pressing P. I don’t see leaks from just pressing O and P once, repeatedly. (Other leaks appear but are attributed to engine code, those aren’t relevant here.) Fixing that potential leak would be by making sure to clean up the existing thing before creating a new one.

If you’re not creating multiple times before destroying, then it would be most helpful if a simple project was shared with exact reproduction steps, or a script that runs things in exactly the pattern that reproduces the issue without user intervention.

So the unity engine can produce leaks also? That’s this part that you are seeing right?

Leak Detected : Persistent allocates 35 individual allocations.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 1 leak(s) from callstack:
0x0000022a2825e58b (Mono JIT Code) Unity.Collections.NativeArray`1<uint16>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<uint16>&)
0x0000022a2825e493 (Mono JIT Code) Unity.Collections.NativeArray`1<uint16>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x00000229b0bde27b (Mono JIT Code) UnityEngine.UIElements.UIR.Page/DataSet`1<uint16>:.ctor (UnityEngine.UIElements.UIR.Utility/GPUBufferType,uint,uint,uint,bool)
0x00000229b0bdd2c3 (Mono JIT Code) UnityEngine.UIElements.UIR.Page:.ctor (uint,uint,uint,bool)
0x00000229b0bdb84b (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (UnityEngine.UIElements.UIR.MeshHandle,uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,bool)
0x00000229b0bdb4a3 (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&)
0x00000229b0bdb373 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:UpdateOrAllocate (UnityEngine.UIElements.UIR.MeshHandle&,int,int,UnityEngine.UIElements.UIR.UIRenderDevice,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28277983 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:PaintElement (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827676b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827628b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:ProcessOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2826737b (Mono JIT Code) UnityEngine.UIElements.UIR.RenderChain:ProcessChanges ()
0x0000022a282553cb (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:Update ()
0x0000022a2063aaf6 (Mono JIT Code) UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase)
0x0000022a2824cd0b (Mono JIT Code) UnityEngine.UIElements.Panel:UpdateForRepaint ()

UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 1 leak(s) from callstack:
0x0000022a2825cc6b (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.Vertex>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<UnityEngine.UIElements.Vertex>&)
0x0000022a2825cb63 (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.Vertex>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x00000229b0bdd43b (Mono JIT Code) UnityEngine.UIElements.UIR.Page/DataSet`1<UnityEngine.UIElements.Vertex>:.ctor (UnityEngine.UIElements.UIR.Utility/GPUBufferType,uint,uint,uint,bool)
0x00000229b0bdd253 (Mono JIT Code) UnityEngine.UIElements.UIR.Page:.ctor (uint,uint,uint,bool)
0x00000229b0bdb84b (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (UnityEngine.UIElements.UIR.MeshHandle,uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,bool)
0x00000229b0bdb4a3 (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&)
0x00000229b0bdb373 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:UpdateOrAllocate (UnityEngine.UIElements.UIR.MeshHandle&,int,int,UnityEngine.UIElements.UIR.UIRenderDevice,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28277983 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:PaintElement (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827676b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827628b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:ProcessOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2826737b (Mono JIT Code) UnityEngine.UIElements.UIR.RenderChain:ProcessChanges ()
0x0000022a282553cb (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:Update ()
0x0000022a2063aaf6 (Mono JIT Code) UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase)
0x0000022a2824cd0b (Mono JIT Code) UnityEngine.UIElements.Panel:UpdateForRepaint ()

UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 1 leak(s) from callstack:
0x0000022a2825e58b (Mono JIT Code) Unity.Collections.NativeArray`1<uint16>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<uint16>&)
0x0000022a2825e493 (Mono JIT Code) Unity.Collections.NativeArray`1<uint16>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x00000229b0bde27b (Mono JIT Code) UnityEngine.UIElements.UIR.Page/DataSet`1<uint16>:.ctor (UnityEngine.UIElements.UIR.Utility/GPUBufferType,uint,uint,uint,bool)
0x00000229b0bdd2c3 (Mono JIT Code) UnityEngine.UIElements.UIR.Page:.ctor (uint,uint,uint,bool)
0x00000229b0bdb84b (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (UnityEngine.UIElements.UIR.MeshHandle,uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,bool)
0x00000229b0bdb4a3 (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&)
0x00000229b0bdb373 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:UpdateOrAllocate (UnityEngine.UIElements.UIR.MeshHandle&,int,int,UnityEngine.UIElements.UIR.UIRenderDevice,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28277983 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:PaintElement (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827676b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.U
UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 1 leak(s) from callstack:
0x00000229b0bddadb (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.GfxUpdateBufferRange>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.GfxUpdateBufferRange>&)
0x00000229b0bdd9e3 (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.GfxUpdateBufferRange>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x00000229b0bde403 (Mono JIT Code) UnityEngine.UIElements.UIR.Page/DataSet`1<uint16>:.ctor (UnityEngine.UIElements.UIR.Utility/GPUBufferType,uint,uint,uint,bool)
0x00000229b0bdd2c3 (Mono JIT Code) UnityEngine.UIElements.UIR.Page:.ctor (uint,uint,uint,bool)
0x00000229b0bdb84b (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (UnityEngine.UIElements.UIR.MeshHandle,uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,bool)
0x00000229b0bdb4a3 (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&)
0x00000229b0bdb373 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:UpdateOrAllocate (UnityEngine.UIElements.UIR.MeshHandle&,int,int,UnityEngine.UIElements.UIR.UIRenderDevice,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28277983 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:PaintElement (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827676b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827628b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:ProcessOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2826737b (Mono JIT Code) UnityEngine.UIElements.UIR.RenderChain:ProcessChanges ()
0x0000022a282553cb (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:Update ()
0x0000022a2063aaf6 (Mono JIT Code) UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase)
0x0000022a2824cd0b (Mono JIT Code) UnityEngine.UIElements.Panel:UpdateForRepaint ()

UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 1 leak(s) from callstack:
0x0000022a2825cc6b (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.Vertex>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<UnityEngine.UIElements.Vertex>&)
0x0000022a2825cb63 (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.Vertex>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x00000229b0bdd43b (Mono JIT Code) UnityEngine.UIElements.UIR.Page/DataSet`1<UnityEngine.UIElements.Vertex>:.ctor (UnityEngine.UIElements.UIR.Utility/GPUBufferType,uint,uint,uint,bool)
0x00000229b0bdd253 (Mono JIT Code) UnityEngine.UIElements.UIR.Page:.ctor (uint,uint,uint,bool)
0x00000229b0bdb84b (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (UnityEngine.UIElements.UIR.MeshHandle,uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,bool)
0x00000229b0bdb4a3 (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&)
0x00000229b0bdb373 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:UpdateOrAllocate (UnityEngine.UIElements.UIR.MeshHandle&,int,int,UnityEngine.UIElements.UIR.UIRenderDevice,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28277983 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:PaintElement (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827676b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIE
UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 1 leak(s) from callstack:
0x00000229b0bddadb (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.GfxUpdateBufferRange>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.GfxUpdateBufferRange>&)
0x00000229b0bdd9e3 (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.GfxUpdateBufferRange>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x00000229b0bdd5c3 (Mono JIT Code) UnityEngine.UIElements.UIR.Page/DataSet`1<UnityEngine.UIElements.Vertex>:.ctor (UnityEngine.UIElements.UIR.Utility/GPUBufferType,uint,uint,uint,bool)
0x00000229b0bdd253 (Mono JIT Code) UnityEngine.UIElements.UIR.Page:.ctor (uint,uint,uint,bool)
0x00000229b0bdb84b (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (UnityEngine.UIElements.UIR.MeshHandle,uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,bool)
0x00000229b0bdb4a3 (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&)
0x00000229b0bdb373 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:UpdateOrAllocate (UnityEngine.UIElements.UIR.MeshHandle&,int,int,UnityEngine.UIElements.UIR.UIRenderDevice,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28277983 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:PaintElement (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827676b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827628b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:ProcessOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2826737b (Mono JIT Code) UnityEngine.UIElements.UIR.RenderChain:ProcessChanges ()
0x0000022a282553cb (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:Update ()
0x0000022a2063aaf6 (Mono JIT Code) UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase)
0x0000022a2824cd0b (Mono JIT Code) UnityEngine.UIElements.Panel:UpdateForRepaint ()

UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 6 leak(s) from callstack:
0x0000022a2824ec4b (Mono JIT Code) Unity.Collections.NativeArray`1<Unity.Jobs.JobHandle>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<Unity.Jobs.JobHandle>&)
0x0000022a2825fee3 (Mono JIT Code) Unity.Collections.NativeArray`1<Unity.Jobs.JobHandle>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x0000022a282617c3 (Mono JIT Code) UnityEngine.UIElements.UIR.OpacityIdAccelerator:.ctor ()
0x0000022a2825c17b (Mono JIT Code) UnityEngine.UIElements.UIR.RenderChain:Constructor (UnityEngine.UIElements.BaseVisualElementPanel,UnityEngine.UIElements.UIR.UIRenderDevice,UnityEngine.UIElements.AtlasBase,UnityEngine.UIElements.UIR.VectorImageManager)
0x0000022a28256283 (Mono JIT Code) UnityEngine.UIElements.UIR.RenderChain:.ctor (UnityEngine.UIElements.BaseVisualElementPanel)
0x0000022a2825579b (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:CreateRenderChain ()
0x0000022a2825560c (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:InitRenderChain ()
0x0000022a28255363 (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:Update ()
0x0000022a2063aaf6 (Mono JIT Code) UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase)
0x0000022a2824cd0b (Mono JIT Code) UnityEngine.UIElements.Panel:UpdateForRepaint ()
0x0000022a2824b2d3 (Mono JIT Code) UnityEngine.UIElements.Panel:Repaint (UnityEngine.Event)
0x0000022a2063a377 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel)
0x0000022a2063a1a3 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (int,intptr,bool&)
0x0000022a20639f9f (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration:ProcessEvent (int,intptr)
0x0000022a20639edb (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration/<>c:<.cctor>b__1_2 (int,intptr)
0x0000022a206394b5 (Mono JIT Code) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
0x0000022a206395a6 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_intptr_intptr& (object,intptr,intptr,intptr)
0x00007ffbe5984c2e (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ffbe58bd254 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068)

UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 1 leak(s) from callstack:
0x00000229b0bddadb (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.GfxUpdateBufferRange>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.GfxUpdateBufferRange>&)
0x00000229b0bdd9e3 (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.GfxUpdateBufferRange>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x00000229b0bde403 (Mono JIT Code) UnityEngine.UIElements.UIR.Page/DataSet`1<uint16>:.ctor (UnityEngine.UIElements.UIR.Utility/GPUBufferType,uint,uint,uint,bool)
0x00000229b0bdd2c3 (Mono JIT Code) UnityEngine.UIElements.UIR.Page:.ctor (uint,uint,uint,bool)
0x00000229b0bdb84b (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (UnityEngine.UIElements.UIR.MeshHandle,uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,bool)
0x00000229b0bdb4a3 (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&)
0x00000229b0bdb373 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:UpdateOrAllocate (UnityEngine.UIElements.UIR.MeshHandle&,int,int,UnityEngine.UIElements.UIR.UIRenderDevice,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28277983 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:PaintElement (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827676b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 
UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 6 leak(s) from callstack:
0x0000022a2825cc6b (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.Vertex>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<UnityEngine.UIElements.Vertex>&)
0x0000022a2825cb63 (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.Vertex>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x0000022a2825c9e3 (Mono JIT Code) UnityEngine.UIElements.UIR.TempAllocator`1<UnityEngine.UIElements.Vertex>:.ctor (int,int,int)
0x0000022a2825c02b (Mono JIT Code) UnityEngine.UIElements.UIR.RenderChain:Constructor (UnityEngine.UIElements.BaseVisualElementPanel,UnityEngine.UIElements.UIR.UIRenderDevice,UnityEngine.UIElements.AtlasBase,UnityEngine.UIElements.UIR.VectorImageManager)
0x0000022a28256283 (Mono JIT Code) UnityEngine.UIElements.UIR.RenderChain:.ctor (UnityEngine.UIElements.BaseVisualElementPanel)
0x0000022a2825579b (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:CreateRenderChain ()
0x0000022a2825560c (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:InitRenderChain ()
0x0000022a28255363 (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:Update ()
0x0000022a2063aaf6 (Mono JIT Code) UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase)
0x0000022a2824cd0b (Mono JIT Code) UnityEngine.UIElements.Panel:UpdateForRepaint ()
0x0000022a2824b2d3 (Mono JIT Code) UnityEngine.UIElements.Panel:Repaint (UnityEngine.Event)
0x0000022a2063a377 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel)
0x0000022a2063a1a3 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (int,intptr,bool&)
0x0000022a20639f9f (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration:ProcessEvent (int,intptr)
0x0000022a20639edb (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration/<>c:<.cctor>b__1_2 (int,intptr)
0x0000022a206394b5 (Mono JIT Code) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
0x0000022a206395a6 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_intptr_intptr& (object,intptr,intptr,intptr)
0x00007ffbe5984c2e (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ffbe58bd254 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068)

UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 1 leak(s) from callstack:
0x0000022a2829261b (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.ConvertMeshJobData>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.ConvertMeshJobData>&)
0x0000022a28292523 (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.ConvertMeshJobData>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x0000022a28292023 (Mono JIT Code) UnityEngine.UIElements.UIR.NativePagedList`1<UnityEngine.UIElements.UIR.ConvertMeshJobData>:Add (UnityEngine.UIElements.UIR.ConvertMeshJobData&)
0x0000022a28291d73 (Mono JIT Code) UnityEngine.UIElements.UIR.JobManager:Add (UnityEngine.UIElements.UIR.ConvertMeshJobData&)
0x0000022a28278b4b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:PaintElement (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827676b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono J
UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 6 leak(s) from callstack:
0x0000022a2824ec4b (Mono JIT Code) Unity.Collections.NativeArray`1<Unity.Jobs.JobHandle>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<Unity.Jobs.JobHandle>&)
0x0000022a2825fee3 (Mono JIT Code) Unity.Collections.NativeArray`1<Unity.Jobs.JobHandle>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x0000022a2825fdf3 (Mono JIT Code) UnityEngine.UIElements.UIR.JobMerger:.ctor (int)
0x0000022a2825f03b (Mono JIT Code) UnityEngine.UIElements.UIR.JobManager:.ctor ()
0x0000022a2825c0fb (Mono JIT Code) UnityEngine.UIElements.UIR.RenderChain:Constructor (UnityEngine.UIElements.BaseVisualElementPanel,UnityEngine.UIElements.UIR.UIRenderDevice,UnityEngine.UIElements.AtlasBase,UnityEngine.UIElements.UIR.VectorImageManager)
0x0000022a28256283 (Mono JIT Code) UnityEngine.UIElements.UIR.RenderChain:.ctor (UnityEngine.UIElements.BaseVisualElementPanel)
0x0000022a2825579b (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:CreateRenderChain ()
0x0000022a2825560c (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:InitRenderChain ()
0x0000022a28255363 (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:Update ()
0x0000022a2063aaf6 (Mono JIT Code) UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase)
0x0000022a2824cd0b (Mono JIT Code) UnityEngine.UIElements.Panel:UpdateForRepaint ()
0x0000022a2824b2d3 (Mono JIT Code) UnityEngine.UIElements.Panel:Repaint (UnityEngine.Event)
0x0000022a2063a377 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel)
0x0000022a2063a1a3 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (int,intptr,bool&)
0x0000022a20639f9f (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration:ProcessEvent (int,intptr)
0x0000022a20639edb (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration/<>c:<.cctor>b__1_2 (int,intptr)
0x0000022a206394b5 (Mono JIT Code) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
0x0000022a206395a6 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_intptr_intptr& (object,intptr,intptr,intptr)
0x00007ffbe5984c2e (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)

UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 6 leak(s) from callstack:
0x0000022a2825e58b (Mono JIT Code) Unity.Collections.NativeArray`1<uint16>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<uint16>&)
0x0000022a2825e493 (Mono JIT Code) Unity.Collections.NativeArray`1<uint16>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x0000022a2825e313 (Mono JIT Code) UnityEngine.UIElements.UIR.TempAllocator`1<uint16>:.ctor (int,int,int)
0x0000022a2825c09b (Mono JIT Code) UnityEngine.UIElements.UIR.RenderChain:Constructor (UnityEngine.UIElements.BaseVisualElementPanel,UnityEngine.UIElements.UIR.UIRenderDevice,UnityEngine.UIElements.AtlasBase,UnityEngine.UIElements.UIR.VectorImageManager)
0x0000022a28256283 (Mono JIT Code) UnityEngine.UIElements.UIR.RenderChain:.ctor (UnityEngine.UIElements.BaseVisualElementPanel)
0x0000022a2825579b (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:CreateRenderChain ()
0x0000022a2825560c (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:InitRenderChain ()
0x0000022a28255363 (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:Update ()
0x0000022a2063aaf6 (Mono JIT Code) UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase)
0x0000022a2824cd0b (Mono JIT Code) UnityEngine.UIElements.Panel:UpdateForRepaint ()
0x0000022a2824b2d3 (Mono JIT Code) UnityEngine.UIElements.Panel:Repaint (UnityEngine.Event)
0x0000022a2063a377 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel)
0x0000022a2063a1a3 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (int,intptr,bool&)
0x0000022a20639f9f (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration:ProcessEvent (int,intptr)
0x0000022a20639edb (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration/<>c:<.cctor>b__1_2 (int,intptr)
0x0000022a206394b5 (Mono JIT Code) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
0x0000022a206395a6 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_intptr_intptr& (object,intptr,intptr,intptr)
0x00007ffbe5984c2e (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ffbe58bd254 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068)

UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 1 leak(s) from callstack:
0x0000022a2829261b (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.ConvertMeshJobData>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.ConvertMeshJobData>&)
0x0000022a28292523 (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.ConvertMeshJobData>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x0000022a28292023 (Mono JIT Code) UnityEngine.UIElements.UIR.NativePagedList`1<UnityEngine.UIElements.UIR.ConvertMeshJobData>:Add (UnityEngine.UIElements.UIR.ConvertMeshJobData&)
0x0000022a28291d73 (Mono JIT Code) UnityEngine.UIElements.UIR.JobManager:Add (UnityEngine.UIElements.UIR.ConvertMeshJobData&)
0x0000022a28278b4b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:PaintElement (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827676b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827628b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:ProcessOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2826737b (Mono JIT Code) UnityEngine.UIElements.UIR.RenderChain:ProcessChanges ()
0x0000022a282553cb (Mono JIT Code) UnityEngine.UIElements.UIRRepaintUpdater:Update ()
0x0000022a2063aaf6 (Mono JIT Code) UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase)
0x0000022a2824cd0b (Mono JIT Code) UnityEngine.UIElements.Panel:UpdateForRepaint ()
0x0000022a2824b2d3 (Mono JIT Code) UnityEngine.UIElements.Panel:Repaint (UnityEngine.Event)
0x0000022a2063a377 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel)
0x0000022a2063a1a3 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (int,intptr,bool&)

UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 1 leak(s) from callstack:
0x00000229b0bddadb (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.GfxUpdateBufferRange>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.GfxUpdateBufferRange>&)
0x00000229b0bdd9e3 (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.GfxUpdateBufferRange>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x00000229b0bdd5c3 (Mono JIT Code) UnityEngine.UIElements.UIR.Page/DataSet`1<UnityEngine.UIElements.Vertex>:.ctor (UnityEngine.UIElements.UIR.Utility/GPUBufferType,uint,uint,uint,bool)
0x00000229b0bdd253 (Mono JIT Code) UnityEngine.UIElements.UIR.Page:.ctor (uint,uint,uint,bool)
0x00000229b0bdb84b (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (UnityEngine.UIElements.UIR.MeshHandle,uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,bool)
0x00000229b0bdb4a3 (Mono JIT Code) UnityEngine.UIElements.UIR.UIRenderDevice:Allocate (uint,uint,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&)
0x00000229b0bdb373 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:UpdateOrAllocate (UnityEngine.UIElements.UIR.MeshHandle&,int,int,UnityEngine.UIElements.UIR.UIRenderDevice,Unity.Collections.NativeSlice`1<UnityEngine.UIElements.Vertex>&,Unity.Collections.NativeSlice`1<uint16>&,uint16&,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28277983 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:PaintElement (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827676b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStat
UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

Found 1 leak(s) from callstack:
0x0000022a283e3ceb (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.CopyClosingMeshJobData>:Allocate (int,Unity.Collections.Allocator,Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.CopyClosingMeshJobData>&)
0x0000022a283e3bf3 (Mono JIT Code) Unity.Collections.NativeArray`1<UnityEngine.UIElements.UIR.CopyClosingMeshJobData>:.ctor (int,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions)
0x0000022a283e36bb (Mono JIT Code) UnityEngine.UIElements.UIR.NativePagedList`1<UnityEngine.UIElements.UIR.CopyClosingMeshJobData>:Add (UnityEngine.UIElements.UIR.CopyClosingMeshJobData&)
0x0000022a283e33a3 (Mono JIT Code) UnityEngine.UIElements.UIR.JobManager:Add (UnityEngine.UIElements.UIR.CopyClosingMeshJobData&)
0x0000022a282b421b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.CommandGenerator:ClosePaintElement (UnityEngine.UIElements.VisualElement,UnityEngine.UIElements.UIR.Implementation.UIRStylePainter/ClosingInfo,UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a2827695b (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.VisualElement,uint,bool,bool,UnityEngine.UIElements.UIR.ChainBuilderStats&)
0x0000022a28276843 (Mono JIT Code) UnityEngine.UIElements.UIR.Implementation.RenderEvents:DepthFirstOnVisualsChanged (UnityEngine.UIElements.UIR.RenderChain,UnityEngine.UIElements.Vis
UnityEngine.StackTraceUtility:ExtractStackTrace ()
_Editor:Update () (at Assets/Test.cs:25)

In my test project I only see those leaks when using the code you provided.

UnsafeUtility.ForgiveLeaks(); 
UnsafeUtility.CheckForLeaks(); 

But on my main project I see those leaks all the time, even without using that code. They can be safely ignored?

CheckForLeaks just checks for tracked allocations that haven’t been freed yet. There could be new allocations between the ForgiveLeaks and CheckForLeaks that will be freed later, so leak detection in those cases isn’t particularly informative. If, on the other hand, leaks are detected on domain reload / shutdown, that would more reliably indicate a leak. The call stacks are to do with UI Toolkit, and leaks on domain reload aren’t expected, but it’s not relevant to the issue at hand. Still, one thing to do (again, as has been mentioned a few times) is to update the editor to the latest release in the stream to receive fixes for things, which could include leaks of this sort.

Ahh ok. Ya that was confusing me why I was seeing them in my test project because they looked similar. I just found out the problem though and ya I was doing something stupid like I thought.

    // GETCHUNK:  returns a reference to a chunk based on its position
    public bool GetChunk(int3 position, out Chunk chunk)
    {
        if (_.game.map.chunks.ContainsKey(position)) {
            chunk = _.game.map.chunks[position];
            return true;
        } else {
            chunk = new Chunk(0,0,0); // PROBLEM
            return false;
        }
    }

I was reformatting my code and I changed my chunk code from a struct to a class and every time I was getting a chunk it was creating new allocations in the constructor.

Sorry for the stupid questions and thanks for the help Spy-Master.

No, you were refactoring. Reformatting doesn’t alter the logic. :wink:

In any case, you ought to write unit tests for those instrumental classes, not just a test project. This would let you refactor, and then confirm that everything still works (or doesn’t and so you can fix it right away, which is often 5 minutes of work, not days of wondering and debugging).

1 Like

Yes, that’s the one! :joy:

Sounds like it’s over my head but I will look into if, thx CodeSmile.