Author Topic: NGUI 2.x.x Android Performance and Memory Huge Problems, Please Help!!!  (Read 2877 times)

newDeveloper

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Hi guys
I am working with NGUI 2.x.x. I think 2.6.1 or 2.6.3 one of these.
I have done all the GUI, but as targetted on Android App, I am facing that it lags too much,
I have studied on these forums and I have applied all the techniques came under my eyes, like Panel.static, Panel.cull.
As a large GUI, I have Profiled to see more precise details and i found that
Textures: 0.56 GB,
I deleted the NGUI and pressed Play and then there was only
Textures: 176 MB.

About 300 MB are took by NGUI, when I have only 4-5 Atlases, all lesser then 512x512 and the last 2048x2048 (16 MBytes).
My atlas textures does not pass 25 MB if we want to Floor the value.

Seeing this I tried to break my GUI into several Prefabs, Instantiate and destroy them as I need, using a Loading Screen, but it didnt helped me because the Profiler is still saying exactly the same value.

So this cause the app to close (crash due to memory issue) after few minutes of use, and the application is countinuesly lagging while also not using, only stopped, no gui movement, or anything.

Another thing i tried to do is that as I saw that modifying Panel.MAlpha with Animation to move from one screen to another was heavy. I have replaced the animation with just movement, but it is still heavy.
At last I have also modified UIButton and UIButtonColor, making comment the codelines which was doing Hover and Active.
But not enough change made this optimization passes.

Hope some one can help.
Thanks.
newDev

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: NGUI 2.x.x Android Performance and Memory Huge Problems, Please Help!!!
« Reply #1 on: September 25, 2014, 02:34:51 AM »
Instead of testing directly in the editor, try to make a build and connect to that, this will give you a clearer picture of the exact values, as the Unity Editor otherwise will pollute the values with its own usages as well.

Other than that there's not much to say - it's generally worth only loading the stuff you need, so everything isn't there in the beginning if there's a lot. That said with only a single 2kx2k atlas and some smaller ones, you shouldn't be anywhere near 300 MB.

newDeveloper

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: NGUI 2.x.x Android Performance and Memory Huge Problems, Please Help!!!
« Reply #2 on: September 25, 2014, 05:17:40 AM »
I have done the build on Android (Nexus 7 2012) after few minutes (around 3-5) it crashes, and android tooks about half minute to reload the Android Interface.
These are the atlas details:
Atlas 0 = 64x64 RGBA 32bit 16.0 KB
Atlas 1 = 512x512 RGBA 32bit 1.0 MB
Atlas 2 = 256x256 RGBA 32bit 256.0 KB
Atlas 3 = 2048x2048 RGBA 32bit 16.0 MB
Atlas 4 = 512x512 RGBA 32bit 1.0 MB
Atlas 5 = 256x256 RGBA 32bit 256.0 KB
These Atlas are 18.5 MB + 16 KB

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: NGUI 2.x.x Android Performance and Memory Huge Problems, Please Help!!!
« Reply #3 on: September 26, 2014, 05:53:49 PM »
Take a look at your editor log and see what assets are packed with it. Remember that anything in Resources is packed in your build.

Try to see if something is leaking memory. NGUI shouldn't be, even in 2.0, but it may be because of some way you're using it.