x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

  1. Editing the parameters or transforms of a blueprint asset that has construction script code executing. The editor appears to accumulate objects in memory every Time such a blueprint asset is adjusted. Seemingly adding the number of components present in the blueprint each Time the asset is updated. Deleting some object in the level seems to cause the editor to remove the excess objects, but little to no memory is reclaimed.

  2. Having a blueprint window open at all also appears to cause memory usage to inflate.I can open a blueprint window and just watch the memory usage grow at roughly the rate of 1MB per second or two. Closing the window stops the inflation, but no memory is reclaimed. Over the course of a work session, this slow growth will eventually use up all system memory and cause Windows to close the editor.

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

Product Version: UE 4.10
Tags:
more ▼

asked Nov 23 '15 at 06:56 AM in Bug Reports

avatar image

GaryDoesThings
48 3 7 8

avatar image Matthew J Nov 24 '15 at 07:50 PM

Hello GaryDoesThings,

I'll be looking into the first issue shown in your video with the objects being kept with construction script. The second issue you reported however, the one with the blueprint tab, is already reported under the number UE-21203. We hope to have it fixed soon but it seems the easiest way to avoid the majority of the memory leak in the meantime is to always keep the extra tabs docked to the main editor and keep it maximized.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

Hi there,

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.

more ▼

answered May 03 '16 at 06:30 PM

avatar image

sks-xovangam
141 1 3 3

avatar image GaryDoesThings May 04 '16 at 09:14 PM

Yes, the main issue does appear to have been solved with 4.11. And thank you for your description of the counters.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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!

more ▼

answered Nov 24 '15 at 08:55 PM

avatar image GaryDoesThings Nov 25 '15 at 01:32 AM

Great, thank you so much for your responses Matthew.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

https://answers.unrealengine.com/questions/325810/memory-leak-while-function-library-open.html

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.

more ▼

answered Nov 23 '15 at 10:18 AM

avatar image

Nilkki
6 1 1

avatar image GaryDoesThings Nov 24 '15 at 01:44 AM

Thank you for your answer. However as of yet, this blueprint is the only one I have with any script, and I don't have any functions defined in within it. Closing that blueprint window does stop the leak, but this just delays the inevitable as no memory is freed when doing so.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question