Copyright © 2026 Unity Technologies
NativeQueue internally implements block caching mechanism that's used by all queues. The reason for memory bump is because on first use static method creates this pool of empty blocks, that are then used at later point.
How to reproduce:
1. Open the attached "IN-98674" project
2. Open the "test" scene
3. Navigate to the project directory and run the "test1.exe" (found in "IN-98674/Builds/test1")
4. In the "test1" window, press the Spacebar
5. Go to “Open Memory Profiler > Capture New Snapshot“
6. Select the captured snapshot
7. Navigate to “All of Memory > Native > Unity Subsystems > UnsafeUtility > Malloc (Persistent)”
8. Observe the “Allocated Size” value
Expected result: Malloc (Persistent) uses around 1.3-1.5KB of memory (similar to other native collections)
Actual result: Malloc (Persistent) uses 4.0MB of memory
Reproducible with: 2022.1.0a10, 2022.3.61f1, 6000.0.47f1, 6000.1.0f1, 6000.2.0a9
Could not test with: 2021.3.51f1 (different Memory Profiler UI made it difficult to locate the Malloc (Persistent) value)
Reproducible on: macOS 15.3 (M4), Windows 11 (by user)
Not reproducible on: No other environments tested
Notes:
Issues you vote on will appear here