Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Some Ram Memory usage questions

Discussion in 'Editor & General Support' started by Nirvan, Jan 5, 2017.

  1. Nirvan

    Nirvan

    Joined:
    Nov 16, 2013
    Posts:
    134
    Hi, I fighting with ram memory usage in my project.
    I have a lot of objects on my scenes (many big scenes in build) with many meshes with high resolution textures.

    I working on few systems and trying to reduce memory but without big success.
    Biggest thing I did is system which takes all objects from scene with component which defines how object is visible in scene (small, medium, big, very big) then creating empty object which holding reference to prefab etc. so scene is only terrain and empty objects with components with references to prefabs.
    When I load scene all components are grouped and prefabs are created only when they are needed (because I saw, destroying object will only unload assets with UnloadUnusedAssets(), but maybe prefab reference in component will not allow to? :( )
    I using it with UnloadUnused assets, it shows very big dirrence in memory profiler in unity editor (meshes memory goes down from 1.1gb to 300mb) and on build with menu and one scene from this big ones, memory usage is very small (800mb) when with all scenes it's above 3gb.

    Can't figure out how unity memory management really works.
    Now I found option in memory tab in profiler, it's "Detailed" button (first there is text "Simple")
    and there I can see more info about memory, thanks for it I optimalized some audio things, but there is mysterious thing in "Other" category, called "Objects" and it takes 1.81gb and no info, no references are given.

    Sometimes on build everything taking 1.7gb and sometimes above 3gb depends of build's mood :O

    What can I do to reduce memory in my project?

    Edit:
    Thanks for "Detailed" I found few textures which aren't compressed and took about 1gb memory, but I see many textures aren't unloaded even they arent used in any material and object in scene.
     
    Last edited: Jan 5, 2017
  2. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Did you ever figure out what Other: Objects was? I've got the same problem.
     
  3. Nirvan

    Nirvan

    Joined:
    Nov 16, 2013
    Posts:
    134
    You mean objects from detailed memory info? I think this are something like editor additional stuff, probably not so big deal after build.
     
  4. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    thanks for the reply!

    I'm looking at memory usage in a build, and the profiler Detailed Stats shows Other: Objects: 1.8 GB and I can't figure out what that is.