What is the lifetime of a Blueprint created runtime Render Target 2D?


I am working on a custom BP 360 camera capture plugin. I am creating several very high res render targets at runtime using Create Render Target 2D BP node. This code is ran during Sequencer capture movie process, which is basically running the level runtime. I am just wondering what is a lifetime of these generated Render Targets? If I create 6 22k render targets for stitched cameras and one 4k2k target to capture final stitched image, that’s a lot of VRAM. If the render targets get destroyed after the sequence movie capture process ends, that’s fine, but if they wait for some garbage collector, then there’s a chance of users running into crashes because of running out of VRAM :expressionless:

Does anyone know?
Thanks in advance.

You should use ConditionalBeginDestroy() on them and set ptr = nullptr when you want them deleted.

If you don’t they will stay in memory until GC kicks in.

** Unless Epic changed things (which they always do)

This is concerning purely blueprint. There’s no C++ code in the project at all :slight_smile: