Author Topic: Atlas consume much memry  (Read 7453 times)

chetanmrane

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Atlas consume much memry
« on: April 05, 2013, 01:16:05 AM »
Hi All

i have updated Unity 4.1.2 pro version which comes up with detailed memory profiling.

The memory consumption of all NGUI atlas are showing me incridible number on windows and mac

on windows all atlas are consuming 5.3mb memory while on mac its 6.0MB

Am i doing something wrong?


milali

  • Guest
Re: Atlas consume much memry
« Reply #1 on: April 05, 2013, 04:37:19 AM »
what's the dimensions of your atlas texture?

chetanmrane

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: Atlas consume much memry
« Reply #2 on: April 05, 2013, 05:13:40 AM »
Most of the atlases are having 1024x1024 resoultion. Few of them are 512x512

But i am using multiple atlases for some screens to keep the atlas size 1024x1024 (reason is - iPod touch and few low end devices were unable to load high resolution atlases)
« Last Edit: April 05, 2013, 06:14:35 AM by chetanmrane »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas consume much memry
« Reply #3 on: April 05, 2013, 11:52:31 AM »
1024x1024 texture is 4 megabytes.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Atlas consume much memry
« Reply #4 on: April 05, 2013, 12:44:56 PM »
You probably have mip maps on.

1024x1024x32 bit is 4 MB. Mip maps add ~30 % (1.3MB) to that.

chetanmrane

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: Atlas consume much memry
« Reply #5 on: April 06, 2013, 06:02:35 AM »
oh i see

but then what will be the best practice to control runtime memory.

i have divided my game into multiple scene ...one scene = one ngui page
the idea is to keep the runtime memory as much controlled as i can...

but then even after unloading scene, ngui atlases eats memory

why is it so?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Atlas consume much memry
« Reply #6 on: April 06, 2013, 01:02:07 PM »
If anything, anything at all, reference your atlases, they will be loaded into active memory. If you keep them in Resources and load them dynamically, you can control them more.

chetanmrane

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: Atlas consume much memry
« Reply #7 on: April 10, 2013, 07:36:17 AM »
how could i load atlases from resource folder

any example??

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Atlas consume much memry
« Reply #8 on: April 10, 2013, 09:23:46 AM »
Save the prefab in Resources and use Resources.Load.
http://docs.unity3d.com/Documentation/ScriptReference/Resources.Load.html