Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Use allocators to control unmanaged memory

Use allocators to control unmanaged memory in Unity Collections.
Read time 1 minuteLast updated 6 days ago

The
Unity.Collections
APIs allocate collections from unmanaged memory, which means they're not managed by the garbage collector. You're responsible for deallocating any unmanaged memory that you don't need. Failing to deallocate large or multiple allocations can waste a lot of memory, which can slow down or crash your application.

Topic

Description

Introduction to allocatorsUnderstand how to use an allocator to manage unmanaged memory.
Aliasing allocatorsCreate aliases, which share memory allocations with another collection.
Rewindable allocatorUnderstand rewindable allocators, which can pre-allocate memory.
Define a custom allocatorUnderstand custom allocators, which you can create for specific memory allocation needs.
Create and use a custom allocatorCreate and use a custom allocator.
Performance referenceUnderstand allocator and container comparative performance with benchmark data.

Additional resources