Search Issue Tracker

Fixed in Unity 2018.2



Found in


Issue ID




[Enlighten] Memory leak. UnityGPUTexture and UnityGPUTextureUpdater objects are being leaked

Global Illumination



Priority: 2Necessary for shipping a final release


Severity: 2Core functionality majorly impacted

[Enlighten] Memory leak. UnityGPUTexture and UnityGPUTextureUpdater objects are being leaked.

1. What happened
When running the attached project originally from with a small modification to make it automatically change between the two test scenes it appears that we are creating UnityGPUTexture and UnityGPUTextureUpdater objects but never releasing them.

This appears to have been one of the original issues in

Tested against db66e9789be1

Currently tested by
1) Building and running the project under the Memory Analyser for PS4 in a development builds. After leavign the build running for 10 mins you can see that there is an increasing number of unfreed UnityGPUTexture and UnityGPUTextureUpdater allocations.
2) Running a debugable PS4 player or debugable Windows Standalone player you can set a breakpoint in the UnityGPUTextureUpdater::Create() function and the UnityGPUTexture::Create() function and see that when realtimeGI.unity is loaded these methods allocate new objects. Setting a breakpoint in UnityGPUTextureUpdater::Release() and UnityGPUTexture::Release() will never have these methods being called. It appears like solving the UnityGPUTexture::Release() will probably take care of calling UnityGPUTextureUpdater::Release().
3) Changing the allocator used for Enlighten in EnlightenRuntimeManager::InitializeClass() from Geo::AnsiAllocator to Geo::GeoMemoryDefault and in UpdateEnlightenRuntimeManager() printing out the total memory in use by this allocator
UInt64 size = g_EnlightenAlloc->GetTotalMemoryInUse();
printf_console("g_EnlightenAlloc->GetTotalMemoryInUse(): %llu\n", size);
each frame. Over muliple scene loads you can see the memory usage going up

2. How we can reproduce it using the example you attached
1) Build the sample to a debugable PC standalone build.
2) Set breakpoints in UnityGPUTextureUpdater::Create() and UnityGPUTexture::Create() and verify they are being created each time realtimeGI.unity is loaded but that UnityGPUTextureUpdater::Release() and UnityGPUTexture::Release() are never called to release the memory.

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.