Dual thread allocator example
Inspect the usage reports of the dual thread allocator.
Read time 1 minuteLast updated 13 days ago
This example uses the memory usage reports that Unity writes to the log when you close the Player or Unity Editor. To create this reports, use the command line argument. To find your project’s log files, follow the instructions on the log files page.
-log-memory-performance-statsCustomize block size
You can customize the block sizes of the two dynamic heap allocators:

Main Allocator, with a custom value for Shared Thread Block Size
Usage report example
The usage report contains information for all three parts of the allocator. For example:
[ALLOC_DEFAULT] Dual Thread Allocator Peak main deferred allocation count 135 [ALLOC_BUCKET] Large Block size 4.0 MB Used Block count 1 Peak Allocated bytes 3.3 MB [ALLOC_DEFAULT_MAIN] Peak usage frame count: [16.0 MB-32.0 MB]: 8283 frames, [32.0 MB-64.0 MB]: 1 frames Requested Block Size 16.0 MB Peak Block count 2 Peak Allocated memory 53.3 MB Peak Large allocation bytes 40.2 MB [ALLOC_DEFAULT_THREAD] Peak usage frame count: [64.0 MB-128.0 MB]: 8284 frames Requested Block Size 16.0 MB Peak Block count 2 Peak Allocated memory 78.3 MB Peak Large allocation bytes 47.3 MB