Page MenuHome

Lookdev HDRIs are never unloaded, a sort of memory leak (+ other HDRI issues)
Closed, InvalidPublic


System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: GeForce GTX 560 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 388.59

Blender Version Broken: version: 2.81 sub 2 , branch: master, commit date: 2019-08-16 18:51, hash: rBe8ffe25eb111

Short description of error
Lookdev never unloads the HDRIs given to it. This results in runaway memory usage, and eventually an OOM crash.

Exact steps for others to reproduce the error
Install a large number of lookdev HDRIs. (50 or more)
Observe memory usage. Several gigabytes will be taken up.
Restart Blender.
Observe memory usage. Blender will use a minimal amount of memory at this point, as expected.
Open the lookdev pop-up, and try to change the HDRI. (Alternatively, open the HDRI manager.)
Observe memory usage as Blender loads in the "thumbnails".
Pick a HDRI and close the pop-up. Memory will still be taken up by all the other ones, no matter how long we work on the scene.

A user's HDRI collection can be potentially large, and the current import and load behavior is very inefficient. Copying the images to the settings folder can have additional bad consequences. (small partition, backup software trying to pick up the HDRIs, waste of disk space when several programs are using the same collection)
Consider importing the images as path+thumbnail only.

Event Timeline

Philipp Oeser (lichtwerk) claimed this task.

Not 100% sure, but there might be ways to free up some data [a Studio Lights' equirect_radiance_buffer is kept forever (alongside other stuff probably) as you mentioned -- for all studio lights].

This happens as soon as we have a call to BKE_studiolight_ensure_flag(sl, STUDIOLIGHT_EXTERNAL_IMAGE_LOADED) -- which includes generating the previews...
So this would mean a different design would need to take effect, where only the previews are kept, unneeded buffers freed and only when actually switching to another studiolight, calculations would happen.

This would be a nice improvement, however this is not strictly a bug (since I dont see this being intended to free unneeded data in ints current state in the code...).

I'll CC @Jeroen Bakker (jbakker) & @Clément Foucault (fclem) here to consider adding this as a TODO to T64282: EEVEE & Viewport Module, but will close this for now [unless these two have objections?], we can always reopen later...

So thx for the report, if this doesnt get added to the roadmap immediately, please consider using other channels for user feedback and feature requests:
For more information on why this isn't considered a bug, visit: