Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Huge RenderTexture leak in 2022.3.9 editor (OSX)

Discussion in 'Editor & General Support' started by DanjelRicci, Sep 12, 2023.

  1. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    304
    Moved from 2020.3.48 to 2022.3.9 recently and I started getting system alerts about running out of memory due to Unity. After a quick profiler check, it seems like "_CameraDepthAttachment" Render Textures are endlessly created and never disposed. I got the attached profiler results in an empty scene, using the Default editor layout. Just submitted bug report IN-54652 (Issue Tracker website does not respond at the moment so I don't have the link for that).
     

    Attached Files:

  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,140
    Hello and thank you for the bug report. Have you tried other 2022 versions, e.g. 2022.2.15f1 or earlier (Note that their size might be faultily reported there, so their count and the system monitor values would be more relevant)? I have an odd-ball suspicion, based on this being the second temp RT leak report I'm seeing on the forums today.
     
  3. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    304
    No sorry, I've jumped straight to 2022.3.9 from 2020.3.48.
    I see there is already a 2022.3.10 version with a similar fix but it looks related to UIElements, which I'm not using. In any case yeah I too think the size might be miscalculated because my system only has 32GB of memory (and I don't have all that free space on disk for virtual memory).
     
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,140
    DanjelRicci likes this.
  5. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,140
  6. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    304
    MartinTilo likes this.
  7. Imre

    Imre

    Joined:
    Sep 27, 2012
    Posts:
    73
    Hi, this huge RenderTexture memory leak was introduced with 2022.3.8f1 version and exists also on PC. It's strange and unacceptable, that this kind of bugs sneak into LTS versions.
     
  8. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,140
    Fair, it should not creep into LTS, but there is a balancing sweet-spot to be hit between the speed of fixes and backports vs completeness of guarding against all possible scenarios. The root cause for this regression has been analyzed, resulted in extra tests, and the data from that and other analyses will be used to optimize that balance and the general process.
     
    Lars-Steenhoff likes this.
  9. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    304
    Hope the fix arrives soon anyways. The editor hits memory limit very quickly and closing and reopening Unity dozen of times a day wasn't really on my workflow until now.
     
  10. Imre

    Imre

    Joined:
    Sep 27, 2012
    Posts:
    73
    Any info, was it fixed in 2022.3.10, we had to rollback to .7, as we hit out-of-memory like in 30 seconds :rolleyes:
     
  11. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    304
    I’ve started using 2022.3.10 as soon as the update landed and the specific problem I reported was definitely fixed, memory is stable. Maybe you encountered a different one? Can you check the Editor memory usage?
     
    MartinTilo likes this.
  12. Imre

    Imre

    Joined:
    Sep 27, 2012
    Posts:
    73
    Ok, installed 2022.3.10 and I can confirm that this issue has been fixed.
     
    MartinTilo likes this.
  13. PrayToWin

    PrayToWin

    Joined:
    Apr 6, 2020
    Posts:
    7
    2022.3.10 , Windows, _CameraDepthAttachment_2205x1149_Depth t:RenderTexture created every frame. From Memory profiler. Is it really fixed?
     
  14. PrayToWin

    PrayToWin

    Joined:
    Apr 6, 2020
    Posts:
    7
  15. PrayToWin

    PrayToWin

    Joined:
    Apr 6, 2020
    Posts:
    7
    It happens just in empty scene.
     
  16. PrayToWin

    PrayToWin

    Joined:
    Apr 6, 2020
    Posts:
    7
    And destroying Library folder fix it.
     
    MartinTilo likes this.
  17. PrayToWin

    PrayToWin

    Joined:
    Apr 6, 2020
    Posts:
    7
    Memory Leak is back as soon as I switch to Android.
    It happens when I use "Always Refresh" and Alt-Tab to another app, Chrome or Photoshop for example, while Unity stay active in background.
    upload_2023-10-2_14-26-10.png
     
  18. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,140
    oh dmn, can you please file a bug report about that via the Editor menu
    Help > Report a Bug
    and post the issue ID here (once you get an email reply from us) to make sure that we can look at and fix this in a (hopefully) speedy manner?

    (Also, I fully expect that to be a separate issue that might have coexisted and just not been seen when fixing the other leaks as its likely happening somewhere slightly different)