Summary
Using Hud Message Device’s Show() function inside loop with Sleep argument lower then 0.1 causes memory leak.
I guess there is some hidden Minimum Show Duration value, which makes widgets stay longer than they should.
Here’s an example of the loop:
ActivateTest(a:agent):void=
for(i:=0..99):
spawn{Test3(a)}
TestThread(a:agent)<suspends>:void=
loop:
if(not BreakLoop?):
HudMessageDevice.Show(a)
Sleep(0.0)
Please select what you are reporting on:
Unreal Editor for Fortnite
What Type of Bug are you experiencing?
Devices
Steps to Reproduce
- Write a simple endless loop that will use hud_message_device.Show() with Sleep(0.0)
- Subscribe this code to some Event that will activate it (for example, to Button’s .InteractedWithEvent )
- I also recommend adding Tick Rate Graph Device snippet to get visual representation of what is going on.
- Launch with session with all devices ready and activate loop
- Wait for 5-10 minutes
Expected Result
Map doesn’t lag and performance stays normal, no matter how long session has lasted
Observed Result
Performance will slowly go down and map will become laggy
Platform(s)
PC
Additional Notes
Changing Sleep to 0.1, even with an increased number of loops wont cause gradual performance degradation.
I strongly recommend using Tick Rate Graph Device snippet, so it will be easier to see how map performance goes down.
https://dev.epicgames.com/community/snippets/D98/fortnite-tick-rate-graph-device