# RemoveWidget Function Does Not Clean Up Properly

**URL:** <https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515>\
**Category:** Issues and Bug Reporting\
**Tags:** fortnite-creative, unreal-editor-for-fortnite, fortnite\
**Created:** [July 11, 2024, 10:12pm UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515 "2024-07-11T22:12:36Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![OohWowow](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/oohwowow/32/1003445_2.png) [@OohWowow](https://forums.unrealengine.com/u/OohWowow)\
**Post date:** [July 11, 2024, 10:12pm UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/1 "2024-07-11T22:12:36Z")

</div>

### 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

---

<div class="post-metadata">

**Author:** ![Bug-Reporter](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bug-reporter/32/997076_2.png) [@Bug-Reporter](https://forums.unrealengine.com/u/Bug-Reporter)\
**Post date:** [July 15, 2024, 9:16pm UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/3 "2024-07-15T21:16:01Z")

</div>

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

Closing this one as a dupe of FORT-767181

---

<div class="post-metadata">

**Author:** ![pauly.G](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pauly.g/32/731160_2.png) [@pauly.G](https://forums.unrealengine.com/u/pauly.G)\
**Post date:** [July 16, 2024, 10:02pm UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/4 "2024-07-16T22:02:29Z")

</div>

```auto
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

---

<div class="post-metadata">

**Author:** ![OohWowow](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/oohwowow/32/1003445_2.png) [@OohWowow](https://forums.unrealengine.com/u/OohWowow)\
**Post date:** [July 17, 2024, 5:34pm UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/5 "2024-07-17T17:34:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pauly.G](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pauly.g/32/731160_2.png) [@pauly.G](https://forums.unrealengine.com/u/pauly.G)\
**Post date:** [July 17, 2024, 7:04pm UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/6 "2024-07-17T19:04:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [July 18, 2024, 5:47pm UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/7 "2024-07-18T17:47:55Z")

</div>

Probably related : [Classes never garbage collected?](https://forums.unrealengine.com/t/classes-never-garbage-collected/1720618)

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

---

<div class="post-metadata">

**Author:** ![ZeroShotBob](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zeroshotbob/32/1069797_2.png) [@ZeroShotBob](https://forums.unrealengine.com/u/ZeroShotBob)\
**Post date:** [July 22, 2024, 12:06pm UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/8 "2024-07-22T12:06:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![OohWowow](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/oohwowow/32/1003445_2.png) [@OohWowow](https://forums.unrealengine.com/u/OohWowow)\
**Post date:** [July 23, 2024, 2:42am UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/9 "2024-07-23T02:42:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ZeroShotBob](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zeroshotbob/32/1069797_2.png) [@ZeroShotBob](https://forums.unrealengine.com/u/ZeroShotBob)\
**Post date:** [July 23, 2024, 12:20pm UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/10 "2024-07-23T12:20:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![OohWowow](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/oohwowow/32/1003445_2.png) [@OohWowow](https://forums.unrealengine.com/u/OohWowow)\
**Post date:** [July 23, 2024, 3:38pm UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/11 "2024-07-23T15:38:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ZeroShotBob](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zeroshotbob/32/1069797_2.png) [@ZeroShotBob](https://forums.unrealengine.com/u/ZeroShotBob)\
**Post date:** [July 23, 2024, 3:47pm UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/12 "2024-07-23T15:47:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![OohWowow](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/oohwowow/32/1003445_2.png) [@OohWowow](https://forums.unrealengine.com/u/OohWowow)\
**Post date:** [November 2, 2024, 4:58am UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/13 "2024-11-02T04:58:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ZeroShotBob](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zeroshotbob/32/1069797_2.png) [@ZeroShotBob](https://forums.unrealengine.com/u/ZeroShotBob)\
**Post date:** [November 3, 2024, 2:50am UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/14 "2024-11-03T02:50:18Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![OohWowow](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/oohwowow/32/1003445_2.png) [@OohWowow](https://forums.unrealengine.com/u/OohWowow)\
**Post date:** [December 9, 2024, 10:21pm UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/16 "2024-12-09T22:21:35Z")

</div>

WOOOOOOO 🎉

---

<div class="post-metadata">

**Author:** ![Bug-Reporter](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bug-reporter/32/997076_2.png) [@Bug-Reporter](https://forums.unrealengine.com/u/Bug-Reporter)\
**Post date:** [January 21, 2025, 8:22pm UTC](https://forums.unrealengine.com/t/removewidget-function-does-not-clean-up-properly/1934515/20 "2025-01-21T20:22:57Z")

</div>

FORT-767181 is ‘Closed’ as ‘Fixed’. The issue will be addressed in 34.00.
