Calling hud_message_device.Show() too fast causes memory leak

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

  1. Write a simple endless loop that will use hud_message_device.Show() with Sleep(0.0)
  2. 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.
  1. Launch with session with all devices ready and activate loop
  2. 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

FORT-936457 has been created and its status is ‘Unconfirmed’. This is now in a queue to be reproduced and confirmed.