Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

"Set timer by event" prevents widget from being destroyed

If I use looping "Set Timer by Event" in a widget blueprint then remove that widget from parent, it never gets destroyed. After creating and removing this kind of widget from parent hundreds of times causes significant fps decrease. Because there are hundreds of instance of that widget and they don't get destroyed.

Expected: Widget should be destroyed after it is not being called by another actor for a period.

Result: It is never being destroyed and never stops working so it is causing low fps on mobile devices if there is an expensive operations in the timers custom event.

--Here is longer version of this bug report:--

I have a widget with a looping timer. Every 5 seconds, it is refreshing it's content which is a little bit slow operation. But, even if I remove this widget from parent, this timer never stops. If a create this widget 100 times and remove all of them from parent, they continue to working and in mobile device fps extremely decreases.

To reproduce:

  1. Create a widget blueprint. Name it "MySlowWidget"

  2. Set a looping "Timer by event". Write 5 into seconds input.

  3. In the custom event of the timer, do iterating very expensive operations that can slow down a mobile device.

  4. Create "Close" button in this widget that removes this widget from parent.

  5. Implement a way to execute "Create MySlowWidget->Add to Viewport". For example implement this to "Anroid Back" button in your player controller class.

  6. Package the game in development mode to the slowest android device that you can find.

  7. Press "Anroid Back" button to create the widget.

  8. Observe fps. It should be decreasing when timer is calling the event. If fps is not decreasing, go back to step 3 and use more expensive functions it the event that is called by timer. If you are able to see fps decrease, continue to next step(9).

  9. Remove created widget from parent by tapping the close button, which you created in step 4.

  10. Recreate widget with "Android Back" button.

  11. Do 9th and 10th steps tens of times.

  12. Close the widget if it is not and now observe fps.

Expected: No significant performance decrease

Result: Fps is around 10

Product Version: UE 4.14
more ▼

asked Nov 27 '16 at 11:40 AM in Bug Reports

avatar image

419 15 28 56

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hello SalihBalkan,

After reading over your post, this appears to be working as intended. Removing a widget does not signal the death of it. It's garbage collected like any other UObject. This means that it remains in memory until garbage collected. I have provided a link to a similar issue. You will see that it was closed as won't fix. I hope that this information helps.

Link: https://issues.unrealengine.com/issue/UE-22560

Make it a great day

more ▼

answered Nov 28 '16 at 07:01 PM

avatar image

Rudy Q ♦♦ STAFF
47.5k 545 132 522

avatar image Two-faced Feb 05 '19 at 11:27 AM

It is weird that working timer prevents pending widget from destroying though.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question