Memory leak or performance issue

Not really sure what is going on. Since upgrading to 4.14 the editor has been crashing a lot, crashing when steamvr is also having problems (missing files and such for some reason). Now today I was doing some testing in blueprints, and when I was exiting the PIE, it started taking a long time to exit. a little longer each time. Then I tried to import a model and it almost locked up my whole system for about 30 seconds, at which point I started loading up the windows task manager. The editor was using 13.7GB of ram on a relatively small scene (not sure what ram usage is when not having problems…) It was also using a fair bit of cpu, tho vrserver.exe and vrcompositor.exe were both using a little more, at 4%. I closed the editor, and it took about 4minutes before it was gone from the task manager. After closing the editor, vrserver and vrcompositor, it was about 5-10 minutes before my system stopped lagging horribly.

The editor didnt crash today, and I’m not sure if this issue was an editor problem, or something else. I’ve included a whole bunch of logs if they’re of any help.

link text

link text

link text

link text

I can reproduce this memory leak and behavior with ue4.14.0 built from source very easily.

  1. create a new bp fps project
  2. press play then stop (play adds about +100mb usage, stop adds an another +300mb)
  3. repeat step 2 until system memory is full

The editor can quit fast (about a few seconds) if i don’t hit the memory limits of my system, but after filling up all the 16GB ram the system gets unstable and exiting the editor might take up to a minute or so to shut the process down. Editor is running from an SSD, but the system pagefile is placed on a HDD.

Image is taken from win7 task manager, the px/sec chart showing the memory consuption of starting the editor and load the template project, press play and stop about ~15 times (raise) then quit the editor application (fall).

115488-memleak_start_play_stop_exiteditor2.jpg

edit: Additional observation, that pressing the posess/eject button will raise the memory as well, however new editor window PIE does not seem consume additional memory (at all, which is odd but helps me to avoid this leak issue for now).

The Launcher version of 4.14.0 also have this issue, the memory continously filled up by 400-500 mb every time the play/stop is pressed.

Launcher and source built 4.13.2 have no such issues.

Both are tested with the corresponding template FPS project version provided by the launcher.

I’m running the launcher version. It was suggested in IRC for me to use the console command “memreport - full” Before and after playing in editor. It seemed to give a bunch of errors, So I’ve included the new project log.
link text

With this log I had been running UE4 for several hours without doing any PIE, just importing/exporting models. After doing the memreports and PIE, I closed the application. Shortly after I got a windows error saying the application had crashed. Here is the description it gave:

Problem signature:

Problem Event Name: APPCRASH

Application Name: UE4Editor.exe

Application Version: 4.14.0.0

Application Timestamp: 5826c1d7

Fault Module Name: ucrtbase.DLL

Fault Module Version: 10.0.10240.16390

Fault Module Timestamp: 55a5b718

Exception Code: 40000015

Exception Offset: 0000000000065a5f

OS Version: 6.1.7601.2.1.0.256.1

Locale ID: 1033

Additional Information 1: df97

Additional Information 2: df97fda058f1ca87af72b102d546eb09

Additional Information 3: 725e

Additional Information 4: 725e5b7e39a68a8a07479344f26b8a33

I’ve been done the “memreport -full” before and after PIE, and then compared the resulting two .memreport log files with winmerge which pointed out the only difference between the shots was the Platform Memory Stats, but that’s only a summary report.

Before:

Process Physical Memory: 5211.16 MB used, 5211.16 MB peak
Process Virtual Memory: 5836.79 MB used, 5898.93 MB peak
Physical Memory: 10518.35 MB used,  5808.52 MB free, 16326.87 MB total
Virtual Memory: 6566.20 MB used,  5808.52 MB free, 8388608.00 MB total

After:

Process Physical Memory: 5648.56 MB used, 5648.56 MB peak
Process Virtual Memory: 6285.20 MB used, 6347.35 MB peak
Physical Memory: 10957.73 MB used,  5369.14 MB free, 16326.87 MB total
Virtual Memory: 7008.45 MB used,  5369.14 MB free, 8388608.00 MB total

The rest of the logs are identical, which means this logging method will unable to help.

Edit: also measured “obj list -alphasort” in similar fashion but that is showing identical result as well.

Hey everybody,

Please see here on how to debug your memory leak issues: https://www.unrealengine.com/blog/dealing-with-memory-leaks-in-ue4
Debugging and Optimizing Memory - Unreal Engine

You’ll find many things occur due to an item on tick. Even having a print string on tick can bloat your output log and increase memory substantially over time.

Hey !

While your suggestion is very good for measuring project level issues, it unfortunately won’t help to investigate the error we are described here. The memory leak can even be reproduced with the launcher version of templates (eg no user changes are requried), as it is a general Editor error. I’m sure there must be a lot repro available here, but you can easily reproduce it when play/stop the project or pressing the possess/eject buttons.

UE 4.14.0-preview 1 (built from source) have no issues at all, whereas the release version of 4.14.0 is producing memory leaks in both events.

Here is the most simple repro i have found so far.

  1. create a new Blank BP project in 4.14.0 release version (both source and launcher version are affected)
  2. press start PIE then stop, you will measure an additional 400+ mbyte of memory usage
  3. repeat step 2 until your system become unresponsive

Alternatively you can use the Possess/Eject buttons, where both button press will adds 400-400 mbytes ram usage that never gets released.

Every memory leak I investigate sounds simple. However it never happens consistently across different machines.

I am not able to reproduce this. I have the OP’s dxdiag, but can I get yours as well?

Also please check here to see if you have any software on our known conflicts list. Some do cause memory leaks.

“never happens consistently across different machines”, but at least should be consistent between engine versions which is not. Like i have been trying to explain this issue i have indeed tested between different engine versions on the same pc machine, and they show different results. 4.14.0 is bogus on our end, although i’m a little surprised that you were unable to reproduce this issue with the current release version on your setup. A related issue from an another user will support that something is not right with the 4.14 build.

SC list is checked and fine. Attached my dxdiag anyways.

dxdiag

Editor and Project preferences are usually left open on my projects. Apparently this is the cause of the leak issue however silly the reason is.

4.14.0 preview 1 and up (including recent source build and released launcher version) are all suffer from this memory leak issue once you open both preferences windows then play/eject/possess/stop in PIE. When closing these windows all the reserved extra memory is gained back (freed) and the memory usage falls back to the initial value.

4.13.2 and prior were unaffected.

Can you confirm these observations?

I think the problem could be this: https://answers.unrealengine.com/questions/528389/preferences-windows-cause-memory-leak-and-slowdown.html

Hey Everybody,

Looks like the project settings window was the culprit. I’ve entered UE-39211.

When i put static mesh actors into the level with different physics collision setups, i experienced PIE slowdown/memory leaks.