Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug 2022.3.9 UIElements Memory Leak

Discussion in 'UI Toolkit' started by MousePods, Sep 11, 2023.

  1. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    812
    Hi,

    I upgraded to 2022.3.9f1 and it seems to have a massive memory leak with UIElements.

    I can start a blank 2d(URP) project and open the memory analysis and watch the meshes go up infinitely.

    Is this a known issue?

    Screenshot 2023-09-11 at 3.21.48 PM.png

    Thanks!
     
  2. C-UITools

    C-UITools

    Unity Technologies

    Joined:
    Jun 23, 2021
    Posts:
    31
  3. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    812
    I reported it with ID: IN-54598

    This issue also happens all the way back in 2022.1.0b13.

    Do you know how fast this will be fixed? In my experience, bugs can go 6+ months. I cannot workaround this bug and it effects a ton of people on LTS and below.

    Is there a way to expedite it?

    Thanks
     
  4. CoolieRanks

    CoolieRanks

    Joined:
    Mar 5, 2021
    Posts:
    5

    @C-UITools I am getting this same issue on 2022.3.1f1. Memory leak just spirals out of control. I have been dealing with this for months now. And the instability with render features working/not working between versions has stopped me from trying newer versions of Unity.

    This memory leak has crashed my system by using 100% of my 64gb of ram and after upgrading to 128gb it still happens after only a couple of hours of Unity being open. Any ideas on if there will be a fix for this?
     
  5. CoolieRanks

    CoolieRanks

    Joined:
    Mar 5, 2021
    Posts:
    5
    @C-UITools So I have looked into this further and it looks like in editor the render textures from the ScriptableRenderPass are not being cleaned after every frame, even when calling cmd.ReleaseTemporaryRT(pixelBufferID) from OnCameraCleanup()?

    upload_2023-9-11_22-0-8.png

    upload_2023-9-11_22-6-2.png
     
  6. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,490
    This bug has already been fixed in 2022.3.10f1 and was tracked under UUM-46520
     
    MousePods likes this.
  7. CoolieRanks

    CoolieRanks

    Joined:
    Mar 5, 2021
    Posts:
    5
    @MartinTilo I am currently on 2022.3.1f1 and I am having this issue. Or are these 2 different issues?
     
  8. CoolieRanks

    CoolieRanks

    Joined:
    Mar 5, 2021
    Posts:
    5
    I see mine seems to be a different issue based on that bug report...
     
  9. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,490
    Yes, it would seem like it (that bug and fix is purely related to Text elements in UI TK causing a leak of unnamed Meshes). Please do file a separate report so that yours too can get fixed :)
     
  10. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,490
    Also the fix landed on 3.10f1, not 3.1f1
     
  11. Alexsandro-Natsume

    Alexsandro-Natsume

    Joined:
    Apr 20, 2015
    Posts:
    24
    im getting a memory leak with the particle system.
    create a standard urp scene , create a particle system , change the particle startsize
    you can see in the task manager that the memory usage increase like crazy
    using unity 2022.3.9
     
  12. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,490
    That sounds like yet another entirely separated bug. Could you also please file a separate bug report for that?
     
  13. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,490
  14. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    812
    @MartinTilo

    I don't think the leak was fixed in 2022.3.10f1. I am on 2022.3.12f1 and the leak is still happening with numerous objects. Is this still being looked into?

    It seems to be fixed in 2023.3 but not 2023.1 or 2023.2. Is there a issue tracker for this to be fixed in those versions or did something just change and this issue is not being worked on?

    Screenshot 2023-10-28 at 4.04.07 PM.png
     
    Last edited: Oct 29, 2023
  15. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,490
    @MousePods as I mentioned in your other two threads on that issue, that's a different issue all together and I suspect it might be a mistake in your code with Element creation and Event subscription leaking the created Labels.

    (Also, my apologies for the slow replies, I was deep down a different rabbit hole for a while...)
     
    MousePods likes this.