I have tracked a memory issue with the new editor. I found that the “UBlueprintThumbnailRenderer:raw” is spawning countless SpawnPreviewActor without deleting them every tick when a blueprint asset is visible in the content browser.
I wanted to give a heads up here as it is causing some crashing on my project. After debugging it more, i’ll post it in answerhub
Well the main problem is that the Thumbnail previewer has been changed from 4.11 to 4.12. The thumbnail render now spawns via “SpawnPreviewActor” and then issues an Actor->Destroy() directly afterwards. It does this for every visible blueprint asset over and over depending on its update frequency.
This exposed a weakness in my code for some of my blueprints that have self registering systems. Lets say I register a unit to an array on construction/init that I allocated 2000 spots. Then on its FinishDestroy() routine unregisters. This Editor would crash because the array would finally hit my 2000 allocation limit before the garbage collection cleaned out.
I’m not sure this is considered a straightforward bug or not. I will fix the weakness in my code from this issue, but the garbage collection can start collecting alot of thumbnail preview actors which could lag the editor if alot of blueprints are visible in the content browser.
I can see thousands upon thousands of garbage collected actors queuing up. This should be looked at for performance reasons. =)
I noticed this happening last night as well (wasn’t the issue I thought at first Devero Similar in severity though!)
Here are some repo steps to see it happening, all you need to do is:
Open up a project and find a folder in the content browser with at least 3-4 blueprints in it, more the better. (noticed this is only a blueprint issue, materials don’t have the same effect)
Open up Editor Preferences and ensure that “Show frame rate and memory” is enabled in the General → Miscellaneous tab, then close the preferences window.
Move the mouse over the content browser window containing the 3-4+ blueprint assets and watch the number at the top right of the window named “objs”
With the mouse over the content browser, you should see this number increase rapidly, but will stop increasing if the mouse is not over the content browser. You should also see the Memory increase at a steady rate along with the object count.
I haven’t experienced any crashes, but the rate of increase seems to be linked to the number of assets visible in the content browser from what I can tell. If so, having a folder with many open would eat up ram pretty quickly.
Note: Edited this post to emphasize this is a blueprint asset issue, other assets don’t seem to increase the number at all.
Great additional info . Yeah, i can confirm thousands upon thousands of actors constantly sitting in GC when you have your mouse in the content browser. Hard to imagine the number if someone had lets say 15-20 blueprints in view. =)
After following the repro steps that posted, I was unable to experience an increase in memory.
What sort of numbers are you guys seeing in terms of memory increase when you mouse over the Content Browser?
Also, if you are experiencing a crash, could you please provide the logs from your project’s Saved->Logs folder, and provide the Machine ID from the Crash Reporter window and send the report so I can look it up in our database? Thank you.
Roughly 1000 objects per second, increases ram slowly, around 5-10 mb per second once it hits around 100k. Didn’t want to record a long video, but it does happen during regular use.
(I hope this is the same issue Devero, if not I’ll open a new thread =) )
EDIT: Closer to 5-10mb/s actually, here’s a video showing that increase:
I let it run for quite a while hoping it would produce a crash, but the pace slows down once you get above 1.5 million objects. I left it running for an hour and only got up to 30% of total memory on my system, Here are the results:
–Initial data–
76k obj
678.45mb
120 fps
500k obj |
2,548.36mb |
82 fps
1 million obj |
4,028.44mb |
61 fps
1_5 million obj |
6,374.98mb }
38 fps
1_75 million obj |
7,303.59mb }
29 fps
2 million obj }
6,790.86mb some ram flushed itself when I changed focus to another program |
24 fps
Answerhub is showing the numbers wrong, hope that’s readable.
Here’s one last video at the 2 million mark showing the performance decreases when hovering over the content browser, anywhere else in the window it maxes out at 120fps:
This video is from the brand new FP Project, nothing changed except the setting in editor preferences to show the memory/fps details.
Hi Sean,
This happens to me as well. Do you know whether this has been fixed or not in current 4.12.5 hotfix? Unreal becomes unusable quite often while working a bit with it and it has happened for the last few months since 4.11.
For anyone having this issue still (it seems not to be fixed with 4.12.4 hotfix) an easy workaround is to select view options/view type - columns. This will not create actors when previewing blueprints and the memory/performance is steady. Of course, makes it harder to spot objects but at least if offers a way to have the editor working cleanly.
Sorry I spoke too soon, will delete the post below, this issue is not resolved in version 4.12.5. I was in a project with only 1 blueprint in the folder, which doesn’t cause the issue.
The issue is still occurring in my main (large) project converted to 4.12.5, it’s acting exactly the same as the videos above.
Testing in a new blueprint first person template project also still produces the same results.
Same Repro Steps as before:
Create a new first person blueprint game with starter content
go to Edit → Editor Preferences → Miscellaneous → “Show Frame Rate and Memory”
open the folder named “Blueprints” in the Content Browser, and watch the object count & memory increase with the mouse hovered over that content.
I’ve tested and verified that this issue is still occurring, and have gone back and reopened the bug for additional investigation. Thanks for letting me know that it wasn’t resolved.