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

Question Profiling and managing VRAM in URP?

Discussion in 'Universal Render Pipeline' started by ClosingTime, Sep 29, 2023.

  1. ClosingTime

    ClosingTime

    Joined:
    Nov 23, 2016
    Posts:
    245
    Is there a stand alone tool of the memory profiler?
    Unity seems to leak VRAM and RAM whenever I try to open this memory snapshot file.

    Could it be Unity does not support HDD? Only SSD? It cannot perform such operation when reading from an HDD and cause memory overflow?
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,482
    First off, if you are using Unity version 2022.1 up to 2022.3.9f1, please update to 2022.3.10f1 for that version fixes multiple graphics resources leaks (Meshes for UI Text, Render Textures for SRPs).

    Beyond that: the Standalone Profiler should allow you to use both the ProfileWindow with the Memory Profiler Module, as well as the Memory Profiler Package from a separate process.

    That said, you can also create a script with a static function and a MenuItemAttribute which calls MemoryProfiler.TakeCapture in order to take snapshots of the Editor without opening the Memory Profiler window, or them, and convoluting your data that way.
     
  3. ClosingTime

    ClosingTime

    Joined:
    Nov 23, 2016
    Posts:
    245
    Thanks I was able to find that I used too much graphics memory.
    Once you save a snapshot in the memory profiler, I had a ton of issues just opening that snapshot.
    What I eventually found out that works, is creating a new project, then open the memory file in the project.
    Even then, open it only with a profiler in the editor, and not stand alone profiler.

    I wish there was a stand alone memory profiler that doesn't require to open the editor.
    I thought there was such a thing, but didn't find it.

    Edit: So when you open it, not in the exact way I mentioned. What happens is it's stuck on processing and keeps filling both GPU VRAM and PC RAM.
    I have 64 GB of RAM, and it filled it to the fullest.
     
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,482
    Which version of the Memory Profiler does that happen with? We fixed some such issues in 1.0 and 1.1.0-pre.1 should have more of them fixed?
     
  5. ClosingTime

    ClosingTime

    Joined:
    Nov 23, 2016
    Posts:
    245
    I am using Unity 2022.2.16, Unity Memory Profiler seems to be 1.0.0
     
  6. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,482
    If you could try opening the snapshot with version 1.1.0-pre.3 of the Memory Profiler to check if the issue persist with that version, that'd be great :)

    And if it does still reproduce, could you then please file a bug for this? I'd like to investigate and fix this.
     
  7. ClosingTime

    ClosingTime

    Joined:
    Nov 23, 2016
    Posts:
    245
    I am unable to install the prerelease.
    I was able to install prerelease packages in the past, but now I don't know how

    upload_2023-10-18_13-5-59.png
     
  8. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,482
    You can add the package by name (com.unity.memoryprofiler) and provide the version number (1.1.0-pre.3).
     
  9. ClosingTime

    ClosingTime

    Joined:
    Nov 23, 2016
    Posts:
    245
    I installed it, it seems to work without issues. Thanks!
     
    MartinTilo likes this.