Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Managed memory

Automatically manage the release and allocation of memory in your application.
Read time 1 minuteLast updated 7 days ago

Unity’s managed memory system is a C# scripting environment based on the Mono or IL2CPP Virtual Machines (VMs). The benefit of the managed memory system is that it manages the release of memory, so you don’t need to manually request the release of memory through your code. It makes use of a garbage collector to automatically free memory allocations.

Topic

Description

Managed memory introductionAutomatically manage the release and allocation of memory in your application.
Garbage collector introductionReclaim unused memory in your application.
Garbage collection modesOverview of the different ways that the garbage collector runs.
Configuring garbage collectionSet up the garbage collector in your project.
Tracking garbage collection allocationsMonitor when your application performed garbage collection.
Avoid C# reflection overheadReduce garbage collector overhead by avoiding use of C# reflection at runtime.

Additional resources