Author Topic: using too much memory app crashes in iOS  (Read 4594 times)

Spacez

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
    • View Profile
using too much memory app crashes in iOS
« on: January 14, 2014, 07:55:02 AM »
i'm using NGUI creating a game. In my world scene, i create every page of my game using NGUI and group them in using empty gameobject (as in picture, in each group there are many widgets of the page).

by setting 'setactive' in each group in can swap between each page in my game (i.e. from world to shop).

the problem is there are so many widgets in this 'scene' when i build my game to iOS and try running it using iPad mini and iPhone4, the app crashes when loading this scene.

i got this problem before but not with NGUI so it can be solved by delaying the creation of the objects in my code.
btw, i have no idea with the NGUI problem i'm having now because when i use NGUI i created things using drag&drop in Unity Editor not by the code, that's why i dont know how to delay the instantiation of the objects.

is there any ways to solve this ?
Thank you so much for every help.

Spacez

lzt120

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 68
    • View Profile
Re: using too much memory app crashes in iOS
« Reply #1 on: January 14, 2014, 09:43:44 PM »
Only Loading the need UI when need instead of load all UI in once.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: using too much memory app crashes in iOS
« Reply #2 on: January 14, 2014, 09:47:38 PM »
You are likely using huge atlases, and crash because of excessive texture memory usage.

Spacez

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: using too much memory app crashes in iOS
« Reply #3 on: January 15, 2014, 01:56:25 AM »
Only Loading the need UI when need instead of load all UI in once.

i have no idea how to load just some UIs. I'm newbie here :(



You are likely using huge atlases, and crash because of excessive texture memory usage.

so i need to delete all the atlases and re-create them all ?
if i remove some pictures from atlas and create them using UItexture, does the memory consuming the same ?
i have 4-5 atlases and all of them is not larger than 2048 (some 512, some 1024, and some 2048 though), is that not good enough ?

i think i'm doing something wrong, but don't know what it is. Could you please suggest or elaborate :'(



Thanks so much for all your help.
« Last Edit: January 15, 2014, 03:16:16 AM by Spacez »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: using too much memory app crashes in iOS
« Reply #4 on: January 15, 2014, 10:02:41 PM »
After you perform a build, you can open the editor log from the Console window. In it you should have a list of all the resources that went into your build, sorted by size -- highest to smallest, including the memory required to have them all loaded. I would start there.