RemoveWidget Function Does Not Clean Up Properly

Please select what you are reporting on:

Creative

What Type of Bug are you experiencing?

UI/Tools

Summary

When removing UI widgets created via Verse, using RemoveWidget() causes permanent performance degradation on the server.

We tested this using 5 players, creating and removing a HUD widget each second. After 15 minutes, the TPS of the server becomes permanently erratic with noticeably degraded performance for the player.

It is hard to say exactly what is happening in the background, but if you guys could take a look we would appreciate. Removing HUD elements from the screen is a fundamental aspect of creating games, so the fact that this causes permanent performance loss is concerning.

Steps to Reproduce

  1. Create Widget
  2. Call RemoveWidget()
  3. Repeat once per second for 15 minutes (for a 5 player lobby)
  4. Observe degraded performance

Expected Result

Call RemoveWidget() without loss of performance

Observed Result

Repeated calls of RemoveWidget() permanently degrades server performance

Platform(s)

Windows

The status of FORT-767181 incident has been moved from ‘To Do’ to ‘In Progress’.

1 Like

FORT-767182 incident has been created. Status is ‘Unconfirmed’.

Closing this one as a dupe of FORT-767181

OnBegin<override>()<suspends>:void =
{
    Playspace := GetPlayspace()
    Player := Playspace.GetPlayers()[0] or Err()
    PlayerUI := GetPlayerUI[Player] or Err()

    loop:
        Print("ElapsedTime: {GetSimulationElapsedTime()}")

        Canvases := for(Index := 0..1000):
            Canvas := canvas{}
            PlayerUI.AddWidget(Canvas)
            Canvas

        Sleep(0.0)

        for(Canvas:Canvases):
            PlayerUI.RemoveWidget(Canvas)
}

This throws OOM

2 Likes

even if you increase the sleep, the server performance will degrade quickly

yea it seems like there’s some sort of memory leak or something happening in the background

1 Like

Probably related : Classes never garbage collected?

It would make sense if every classes are not collected that the widget will not remove properly, hence the lags, can’t prove it though

2 Likes

Has anyone observed random occurrences of the widget not be being removed?

1 Like

yes, but it is unclear if it is related to this issue.

In your test of the 5 player lobby with degraded performance did you get random non-removal of the widget?

not in the trials I did for this, in other situations.

Yeah I ran my own test, also no issue with widget not being removed.

I wonder what is causing that issue.

Really unfortunate but I think I am going to have to switch to HUD message device widgets. Once again, another work around because of Epic verse bugs.

1 Like

any update on this issue? this bug is wildly inconvenient to design around

Yes it is. I stopped using Verse widgets for temporary screen graphics and use HUD message devices instead. I only use Verse UI for permanent fixtures on the UI.

Some day they will acknowledge this is a problem…

1 Like