Blueprint Memory Issues
I started a project in 4.10 and I am periodically getting errors from Windows telling me that the system has run out of memory and it needs to close the Unreal. I have 16GB of ram and I am not running anything else memory intensive at any point and my project is quite small.
I turned on the memory usage viewer in the editor and kept an eye on it to see what could be affecting the memory usage. It appears to be linked to two things.
As far as I can tell, I've not implemented any suspect code in my blueprint's construction script.
I've created a video illustrating the situation. https://youtu.be/RI-CmnpA0qs
Windows 10 Pro 64bit (build 10586) Intel i7-4770K 16 GB Ram DirectX 12
asked Nov 23 '15 at 06:56 AM in Bug Reports
The first issue (UE-21203) was resolved in 4.11. That was most likely the source of the low memory warnings, as that appears to have been a true leak.
The second issue (UE-23817) is I think sort of a false positive rather than an actual leak. What happens by default as you drag an instance of a Blueprint Class around in the editor is, that instance is reconstructed for each position change. Thus if the Construction Script is adding components (as it is in this example), you can end up with several new objects being allocated and freed at each delta. For what it's worth, you can disable this behavior for an individual Blueprint Class by opening it in the Blueprint Editor, clicking the "Class Settings" icon in the Toolbar, and unchecking the "Run Construction Script on Drag" option in the "Blueprint Options" section in the Details panel. This will defer any updates to the appearance (i.e. reconstruction) until after the drag is complete.
For additional reference, the memory display in UE4 is tied to the "Working Set" counter in Windows and not a specific UE4 heap allocation space. This means that even as objects are freed inside of UE4, that number may not necessarily go down (internally it includes free space that can, for example, be recycled for use again without incurring a more expensive OS page allocation). It also means that from Process Explorer's point-of-view, UE4 process usage may remain at or near the same level even as objects are freed.
Finally, the object counter display in UE4 includes both allocated and freed objects that have not yet been garbage collected. As the garbage collector runs only periodically, this number may not immediately go down as objects are removed or deleted. You can force a garbage collection pass by opening up the console tab and typing 'obj gc' - this should cause the object count to drop. However, as noted above, reported memory usage may or may not necessarily be decreasing alongside it.
Hope this helps! -phil.
answered May 03 '16 at 06:30 PM
Thank you for reporting this issue GaryDoesThings. I've logged your initial issue with the construction script memory leak under the number UE-23817. As for the other issue, it has already been reported as stated in my previous comment. I hope we can have this fixed as soon as possible.
Have a nice day!
answered Nov 24 '15 at 08:55 PM
We are working with 4.9.2 version of the engine but this bug still remains in 4.10. In our case it helped when we close all open function tabs in the editor.
answered Nov 23 '15 at 10:18 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here