cocos2d: memory question adding child to scenes
i have started with helloworld template.
added some menu and started performance tool->allocation.
result: 1.9MB
ok, added instance variable ccsprite initialized with an image 1024x1024
and started performance tool->allocation.
result: 6MB
ok, now added to the schen with [self addChild...]
performance tool->allocation.
result: 11MB
is that normal?
every sprite i'll add as child will double my memory usage?
thanks
added some menu and started performance tool->allocation.
result: 1.9MB
ok, added instance variable ccsprite initialized with an image 1024x1024
and started performance tool->allocation.
result: 6MB
ok, now added to the schen with [self addChild...]
performance tool->allocation.
result: 11MB
is that normal?
every sprite i'll add as child will double my memory usage?
thanks
I don't see anything you posted above to suggest that, but keep in mind: 1024x1024 is a rather large image.
sob...
1024x1024 were only for test, because i did an app, i thought the total memory allocated was 15MB, allocation tools gave me 30MB....
if you make the same things i did, how many memory allocation tool give you?
thanks
1024x1024 were only for test, because i did an app, i thought the total memory allocated was 15MB, allocation tools gave me 30MB....
if you make the same things i did, how many memory allocation tool give you?
thanks
I use cocos2d on my game CloudJumper, and it uses maybe 4 sprite sheets at 1024x1024, as well as a few other image resources, and about 20 preloaded sound files. Memory allocation generally hovers around 16-18mb for me.
.....
could you make this try:
open new helloworld template, add this to init function:
CCSprite bg=[CCSprite spriteWithFile:@"sprite1024x1024.png"];
open allocation tool and see the memory allocated, till now should be 4MB of the image+something (for me 2MB)
now add
[self addChild:bg];
open allocation tool and see the memory allocated, here i get 11MB...
should be fast to try, ca you?
thanks
could you make this try:
open new helloworld template, add this to init function:
CCSprite bg=[CCSprite spriteWithFile:@"sprite1024x1024.png"];
open allocation tool and see the memory allocated, till now should be 4MB of the image+something (for me 2MB)
now add
[self addChild:bg];
open allocation tool and see the memory allocated, here i get 11MB...
should be fast to try, ca you?
thanks
You're looking at the simulator, not the device. What you see here does not [necessarily] apply there.
Both the allocations you indicate are in GL and outside Cocos' control.
Both the allocations you indicate are in GL and outside Cocos' control.
so could I have in simulator 2 allocation of 4MB and in device no?
i'm working with device for the first time, so all is new for me.
thanks
i'm working with device for the first time, so all is new for me.
thanks
correct. Profile the device; the simulator is (near) meaningless.
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
Adding lots of static shapes in Chipmunk - performance question | TomorrowPlusX | 3 | 9,897 |
Jul 11, 2011 01:39 PM Last Post: Skorche |
|
Child Units | grazhoper | 1 | 3,625 |
Sep 2, 2009 12:25 AM Last Post: AnotherJake |
|
Adding static gravity object | game_ding | 4 | 6,930 |
Mar 28, 2008 05:25 PM Last Post: Skorche |
|
how to call fathers setNeedsDisplay from child. | iluzone | 5 | 8,816 |
Dec 7, 2006 04:11 AM Last Post: iluzone |
|
Adding message handlers | rove | 3 | 5,409 |
Mar 13, 2005 08:53 AM Last Post: sealfin |