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. The 2023.1 beta is now available for testing. To find out what's new, have a look at our 2023.1 feature highlights.
    Dismiss Notice

What is "Other Native Memory" in Memory Profiler?

Discussion in 'Profiler Previews' started by CDGCaleb, Jan 23, 2022.

  1. CDGCaleb

    CDGCaleb

    Joined:
    Jan 24, 2021
    Posts:
    3
    I noticed when memory profiling that almost 50% of my game's memory usage falls into the "Other Native Memory" category. This is a little vague, and I could not find any explanation of it in the documentation. Does anyone know what this category includes?
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,911
    Hello,

    We're aware of its vagueness and are exploring how we can eventually make this breakdown and its categories a bit clearer. Right now, a good part of the issue is that we don't actually know on a per-object basis, how much of the memory we have reported for objects in the snapshot data goes towards CPU vs GPU memory. Their GPU memory would add to the Graphics category, but even types of objects like Texture2D don't fully live on the GPU but have an amount of CPU memory they take up.

    In the meanwhile, I'm currently implementing better explanations for these categories right in the Memory Profiler to be shown on selection. My draft for Other Native Memory is:

    Does that help?
     
    CDGCaleb likes this.
  3. CDGCaleb

    CDGCaleb

    Joined:
    Jan 24, 2021
    Posts:
    3
    Thanks a bunch for the quick response!

    This is definitely helpful, although I'm still a bit confused on one point. :)

    Your draft says that "you can use the Objects and Allocations page and look at the All Native Objects and All Native Allocations tables", but doesn't that contain Graphics/Audio memory as well? Is there a way to exclude all native objects/allocations that do fall into a particular category (e.g. Graphics), so that by process of elimination, all that's left are the "Other Native Objects"?
     
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,911
    It does. But we are:
    A) lacking data on the GPU vs CPU split in the snapshots to filter out Graphics memory and
    B) filtering capabilities in the tables to exclude audio objects or allocations and profiling allocations

    For point A, we are working on getting the data, for point B we are working on new UI Tooltkit tables with better filtering capabilities. The old ones are unmaintainable and IMGUI.
     
  5. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,911
    We might also still end up with completely different high level categories as we improve the Memory Profiler and its data capture.
     
  6. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,911
    The 0.5 update with that change has now been released btw.
     
  7. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    972
    Hi @MartinTilo

    I try to understand this Other Native memory section and still confused how can I understand what it consist of so I can optimize it

    my case looks like almost everything in game allocated in this section:
    upload_2022-6-3_20-48-45.png
    it is from Memory Profiler 0.7 Unity 2020.3.32

    Can you say a bit more about how can I understand where this memory was used please? :)
     
  8. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,033
    @Jes28 Have you been able to exclude that it isn't a sort of memory leak of a specific type that causes this?
    Like does the value adequately decrease as expected step by step if you start removing objects from your scene?
     
  9. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    972
    It was Asset Bundles
    When Unity load Bundle to memory it dont track memory of it and we have other native memory section for it
     
    DragonCoder likes this.