Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-17-2010, 04:02 AM   #1 (permalink)
Divine avenger
 
Johanovski's Avatar
 
Join Date: Nov 2009
Location: Vic, Catalunya (Spain)
Posts: 320
Johanovski is on a distinguished road
Default Leaks and allocations with Cocos2D, help me please!

Hi there!

I'm working in a Cocos2D + Chipmunk project and I've started testing leaks and allocations. I've found plenty of leaks and raising allocations which I can't understand where they come from...

Object allocations: 16 bytes malloc don't stop increasing during gameplay...
Code:
Category: Malloc 16 Bytes
Size: 16
Resp. Library: QuartzCore
Resp. Caller: CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
They keep increasing during gameplay and I don't know where to find it because I don't know where it happens (I don't even know if it's my own code what causes this)...

Memory leaks: Strange GeneralBlocks leaking like hell...
Code:
Leaked object: GeneralBlock-64/48/32
Size: 64, 48, 32 Bytes
Resp. Library: QuartzCore
Resp. Frame: ensure_displays()

Leaked object: CCSprite
Size: 320 Bytes
Resp. Library: UIKit
Resp. Frame: -[UIWindow _sendTouchesForEvent:]
I create the CCSprites and add them to "self" (where I think they are autoreleased when needed) but I don't retain them so there's no need to call release anywhere (in fact I don't do this), so I don't know where to solve it... And the generalBlock leaks even worse, I don't know where they come from and even why...
Anyone can help me with this?

Thanks in advance!


PS: Test are done on the real device, a 3GS iPhone with 3.1.3 OS and I'm working with "cocos2d version 0.99.0 rc" and "Chipmunk v5.1.0".
Johanovski is offline   Reply With Quote
Old 05-17-2010, 08:09 AM   #2 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 7
elifeTeam is on a distinguished road
Default

Do you use addChild method? You should call removeChild Explicitly.
elifeTeam is offline   Reply With Quote
Old 05-17-2010, 10:02 AM   #3 (permalink)
Divine avenger
 
Johanovski's Avatar
 
Join Date: Nov 2009
Location: Vic, Catalunya (Spain)
Posts: 320
Johanovski is on a distinguished road
Default

You're right, I'm using addChild... It's ok if I call "removeAllChildren" at the dealloc method?
Johanovski is offline   Reply With Quote
Reply

Bookmarks

Tags
chipmunk, cocos2d, generalblock, leaking, memory leak

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 308
10 members and 298 guests
Abidullah, ajay123123, Fstuff, guusleijsten, HemiMG, jbro, newDev, pkIDSF, Sami Gh, Steven.C
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,648
Threads: 94,113
Posts: 402,877
Top Poster: BrianSlick (7,990)
Welcome to our newest member, brandon6031
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:48 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0