Search Issue Tracker
By Design
Votes
0
Found in
2021.1.0a2
2021.2
2021.2.0a2
Issue ID
1307442
Regression
Yes
RenderTexture memory usage grows when a script is reimported
How to reproduce:
1. Open the attached "1307442_Repro" project
2. Open the Profiler (Window->Analysis->Profiler)
3. Make sure only the Memory Module is enabled
4. In the Project window right-click on the "NewBehaviourScript" and select "Reimport"
5. In the Module details panel press the "Take Sample Playmode" button
6. Expand the "Scene Memory" And take note of the "RenderTexture" amount
7. Repeat steps 4 through 6
Expected results: The "RenderTexture" doesn't increase after each script reimport
Actual results: The "RenderTexture" increases after each script reimport
Reproducible with: 2021.1.0a2, 2021.1.0b3, 2021.2.0a2
Not Reproducible with: 2018.4.30f1, 2019.4.17f1, 2020.1.17f1, 2020.2.2f1, 2021.1.0a1
Notes:
- The RenderTexture doesn't grow when reimporting any other Asset besides script
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Project window button icons are poorly visible and their shades differ in Light theme
- GC.Alloc called by HDRenderPipeline.LensFlareMergeOcclusionDataDrivenPass() when playing the default HDRP Sample Template project
- Automatic LOD fails and SRP Batcher incompatibility occurs when using spline-based quad-topology meshes
- Editor crashes on D3D12GetInterface when repeatedly enabling and disabling 256 text components
- Flickering bright white dots in the Scene when the Android Platform is selected and DX11 Graphics API is used with Iris(R) Xe Graphics GPU
Resolution Note (2021.1.X):
This is not a leak and is by design.
RenderTexture objects are kept alive as Unity native objects, but this is temporary state - they are garbage collected once Asset Garbage collection kicks in.
Asset gc is triggered automatically on high memory pressure or after scene loads. This can be verified by opening a scene in project, capturing memory and checking that RenderTexture object count drops to 1.