Version: Unity 6.6 Alpha (6000.6)
Language : English
Native memory allocator examples
Dual thread allocator example

Mimalloc allocator example

This example uses the memory usage reports that Unity writes to the log when you close the Player or Unity Editor. To create this report, use the -log-memory-performance-stats command line argument. To find your project’s log files, follow the instructions on the log files page.

You can enable or disable the mimalloc allocator in the Memory Settings window. For more information, refer to Native memory allocators reference.

Example usage report

A mimalloc report displays debug statistics about the sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
. The following example reserved 1.0 GiB of virtual address space for the heap, of which ~66.3 MiB was committed to use.

heap stats:     peak       total     current       block      total#   
  reserved:     1.0 GiB     1.0 GiB     1.0 GiB                          
 committed:    66.3 MiB    66.3 MiB    66.3 MiB                          
     reset:     0      
    purged:     0      
   touched:     0           0           0                                ok
     pages:     9         161          3                                 not all freed
-abandoned:    52          72          52                                not all freed
 -reclaima:    20      
 -reclaimf:     0      
-reabandon:     0      
    -waits:     0      
 -extended:     0      
   -retire:     0      
    arenas:     1      
 -rollback:     0      
     mmaps:    19      
   commits:   371      
    resets:     0      
    purges:     0      
   guarded:     0      
   threads:    45          45           2                                not all freed
  searches:     1.0 avg
numa nodes:     1
   elapsed:     1.151 s
   process: user: 0.000 s, system: 0.000 s, faults: 0, rss: 66.3 MiB, commit: 66.3 MiB

Additional resources

Native memory allocator examples
Dual thread allocator example
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961