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

Question Memory Management Error

Discussion in 'Editor & General Support' started by Toastking, Apr 17, 2024.

  1. Toastking

    Toastking

    Joined:
    Aug 26, 2020
    Posts:
    4
    Hello Unity Community,

    I’m developing an open-world RPG and have encountered a memory management error that I’m struggling to resolve. The error message I receive is:

    “Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 6)”

    This error seems to indicate that some allocations are being held longer than their permitted lifetime and are only being deleted after 6 frames, exceeding the intended 4 frames. Here are some details about my project and what I’ve tried so far:

    • Unity Version: 2023.2.1
    • Graphics Backend: Using DirectX 12
    • Error Context: This error occurs when I open the project, and when I play the scene in the editor.
    • Troubleshooting Done: Memory Profiler (although it was my first time using it) only found out that 2d textures take up eight gigs of ram (I have 32 gigs)

    I would appreciate any insights or advice on how to better track down and resolve this issue. Specifically, I’m looking for guidance on:

    • Effective techniques for identifying the specific allocations causing this issue.
    • Best practices for ensuring allocations are disposed of within their lifetime in a complex Unity project.
    • Any known issues or common pitfalls with Unity’s memory management that might be causing this behavior.

    Thank you in advance for your help!
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,932
    Upgrade to the latest patch level and then check for package updates and upgrade those.

    Unless you are using jobs with the TempJob allocator yourself this is most likely some Unity internal code or package that's causing this error.
     
  3. Toastking

    Toastking

    Joined:
    Aug 26, 2020
    Posts:
    4
    Good to know, I’ll try that out as soon as I can!
     
  4. Toastking

    Toastking

    Joined:
    Aug 26, 2020
    Posts:
    4
    I installed Unity 2023.2.18 and didn't have to update any packages. However, now when i run the scene, I receive 90 different memory leak console warnings.