Real-time thumbnails memory leak

Hello, I’ve noticed something that may be a memory leak when working in Editor. It seems to appear in 4.12 and 4.11, but not in 4.8, and only with Real-time thumbnails enabled(which is by default).

Steps to reproduce:

  1. Create new Project - Blueprint Third Person template.
  2. In content browser create new Animation Blueprint.
  3. Open Event Graph, add Print String node in Event Blueprint Update Animation Event.
  4. Compile, save and close blueprint window.
  5. Put mouse cursor over Content Browser and check both Output log and memory usage in Task Manager.

Output log should look like this:

[...]
LogBlueprintUserMessages: [Test_C_1711] Hello
LogBlueprintUserMessages: [Test_C_1712] Hello
LogBlueprintUserMessages: [Test_C_1713] Hello
LogBlueprintUserMessages: [Test_C_1714] Hello

After few seconds UE4Editor.exe memory usage starts to increase each second, and does not drop. It happens only when mouse cursor is over content browser with Real-time thumbnails enabled, and as mentioned earlier it does not happen in UE 4.8. It happens with Animation Blueprint, C++ objects, and possibly other assets.

When working on an existing project, same thing happens after opening an asset.

Is it a known issue?

After testing it further I’ve found out that this bug will not crash editor. It will take whole RAM though, in Third Person Template memory usage increases by ~1MB/s, for my project it’s ~4MB/s. It wouldn’t be a problem, but playing in New Editor Window(PIE) or Standalone Game has very low performance, and the only way to fix this is to restart the editor. Also it seems to affect only blueprints that are currently displayed in content browser, so for larger projects the problem gets worse.

Hi LM13,

This is one of the reasons you need an isValid? check after Update Animation (like you see in the Third Person AnimBP). Otherwise everything after that will be evaluated for the instance of the AnimBP shown in the AnimBP preview. This also applies to AnimBPs when Real-Time Preview is active. It is evaluating the state of the AnimBP, hence updating animation and printing the string.

Hi ,

Thank you for reply. Printing a string is not a problem here, also IsValid check does not help. I’ve tested a clean, unmodified ThirdPerson template, just open and close ThirdPerson_AnimBP, and put mouse cursor over Content Browser window. I made screenshots showing how memory usage has changed in just few minutes(red box). UE4Editor.exe will eventually take all free memory.

Hey LM13,

Thanks for the additional info. I was able to reproduce this and have entered UE-34636.