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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.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 12-09-2009, 06:27 AM   #1 (permalink)
Divine avenger
 
Johanovski's Avatar
 
Join Date: Nov 2009
Location: Vic, Catalunya (Spain)
Posts: 320
Default How does the allocations work?

Hi there!

After solving a couple of critical memory problems my app runs very well. No memory warnings, no crashes, etc, but after running a time it seems to not release all the memory it should and, after some time, it is killed by the iPhone. However, what is strange is that no memory warning is thrown, so I'm not sure if it crashes due to memory problems... The iPhone logs shows a "Low memory" entry and shows that the app have like 11,000 jettisoned pages (what means when a page is "jettisoned"?), so it seems this is why it gets killed... However, why a memory warning is not thrown? And is there a way to avoid this memory increasing? I think everything is being released when it's not used, but seems that OpenGL's or UIKit's mallocs are not being released and I have no control about this mallocs (where exactly they are being done and if they are released, but I think isn't there a way to control this).
Then the problem is that my app is working fine with memory but seems that code that isn't mine still keeps increasing memory usage while the app is running so, after a time, memory is increased more than it should be...

Does anyone has any idea about this? What can be happening, if it's normal, or if it can be solved?

Thanks!
Johanovski is offline   Reply With Quote
Old 12-09-2009, 07:43 AM   #2 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Ypsilanti, Michigan
Age: 63
Posts: 1,526
Default

Use the simulator and the Instruments software to monitor memory usage.
RLScott is offline   Reply With Quote
Old 12-09-2009, 10:00 AM   #3 (permalink)
Divine avenger
 
Johanovski's Avatar
 
Join Date: Nov 2009
Location: Vic, Catalunya (Spain)
Posts: 320
Default

Hi there!

I've done but I don't understand what's happening... Just increasing number of mallocs and other tiny allocations. My app works fine but I can't prevent memory to increase as time passes so, after a while (maybe after 15 or 25 games, I haven't tested it) memory just starts running out, but no memory warning is thrown... However, the app suddenly stopped and a "Low memory" log is created in the device! Just wondering if there's any way to track this mallocs, see where they come from and prevent them to stay allocated more than what's needed...

Thanks!
Johanovski is offline   Reply With Quote
Old 12-09-2009, 10:56 AM   #4 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 55
Default

Read this thread from BrianSlick, it's the best guide on memory management i have seen yet:

http://www.iphonedevsdk.com/forum/ip...tml#post150375
EAGLE is offline   Reply With Quote
Reply

Bookmarks

Tags
jettisoned, malloc, memory, opengl

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: 256
17 members and 239 guests
2WeeksToGo, @sandris, AdamL, ADY, BrianSlick, Dani77, Dattee, GHuebner, headkaze, mer10, prchn4christ, smithdale87, Thompson22, timle8n1, Touchmint, vigu360
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,747
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

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