Documentation

Unity Engine


Unity Engine


Code reload and assembly load context leaks

Solve an issue where the Unity Editor reports leaked objects after a code reload and keeps your unloaded script assemblies in memory.
Read time 1 minuteLast updated 8 days ago

As you develop and iterate, the Unity Editor automatically reloads your project code as necessary to incorporate changes you make.
It's important to understand how code reload works to avoid issues such as code reload leaks, which can cause memory leaks and other problems in your project.

Topic

Description

Introduction to assembly load context leaksUnderstand how code reload works in the Unity Editor, the role of
AssemblyLoadContext
instances, and the meaning and significance of
AssemblyLoadContext
leaks.
Assembly load context leak report referenceUnderstand and interpret the assembly load context leak report file.
Diagnose and fix assembly load context leaksDiagnose and fix code assembly load context leaks.

Additional resources