I Want My Memory, Apple
gamesfromwithin.com
I Want My Memory, Apple
1–10 of 24 posts
Re: I Want My Memory, Apple
#2Re: I Want My Memory, Apple
#3- Running processes (including background processes) expunge caches, non-visible UI, etc.
- Termination of Safari and Mail, which are kept running to improve the user experience.
In reality, one can use up to approximately 40 megabytes of RAM without triggering an application failure, as long as the memory is not allocated and used before the OS has time to free memory by warning/triggering background processes.
While this is more complicated than a guaranteed minimum available amount of RAM, it does permit applications to consume (and rely on) a relatively fixed amount of RAM, and seems a reasonable compromise on a multi-purpose, non-console consumer device.
Re: I Want My Memory, Apple
#4I'm not sure the author is sufficiently familiar with the iPhone's memory management. The iPhone will terminate a user process if it consumes all available memory before the OS' low-memory handling has triggered low memory warnings, causing (in this order): - Running processes (including background processes) expunge caches, non-visible UI, etc. - Termination of Safari and Mail, which are kept running to improve the…
Even more interresting than the post in itself (wich is very interresting) is the hack proposed by fishermen21 in the comments - http://gamesfromwithin.com/?p=428#comment-1904 - , wich consist roughly of triggering the low memory handling process at the start of the game while reading a video. Nice workaround if you ask me.
Also , maybe someone around here knows, or my question is stupid, but why isn't a virtual memory mechanism implemented into the iphone OS ?
Re: I Want My Memory, Apple
#5I'm not sure the author is sufficiently familiar with the iPhone's memory management. The iPhone will terminate a user process if it consumes all available memory before the OS' low-memory handling has triggered low memory warnings, causing (in this order): - Running processes (including background processes) expunge caches, non-visible UI, etc. - Termination of Safari and Mail, which are kept running to improve the…
Well the way you use memory in a game is non deterministic, so "OS having time to free memory" is not a good enough answer. Although you're totally right that the IPhone wasn't designed as a console, so this process is probably good enough for most apps. Even more interresting than the post in itself (wich is very interresting) is the hack proposed by fishermen21 in the comments - http://gamesfromwithin.com/?p=428#co…
Once the memory is made available to the foremost application, it will not be reclaimed by the operating system; As a game author you do not need to attempt to introduce determinism across all allocations, but instead ensure that initial allocations are not so rapid as to outpace the low-memory handling.
Also , maybe someone around here knows, or my question is stupid, but why isn't a virtual memory mechanism implemented into the iphone OS?
The OS does have a VM, it simply does not have swap space allocated to support paging to disk (flash). Paging would introduce a considerably less enjoyable user experience than forcing applications to account for the available RAM, and significantly decrease flash lifetime.
Re: I Want My Memory, Apple
#6I'm not sure the author is sufficiently familiar with the iPhone's memory management. The iPhone will terminate a user process if it consumes all available memory before the OS' low-memory handling has triggered low memory warnings, causing (in this order): - Running processes (including background processes) expunge caches, non-visible UI, etc. - Termination of Safari and Mail, which are kept running to improve the…
Well the way you use memory in a game is non deterministic, so "OS having time to free memory" is not a good enough answer. Although you're totally right that the IPhone wasn't designed as a console, so this process is probably good enough for most apps. Even more interresting than the post in itself (wich is very interresting) is the hack proposed by fishermen21 in the comments - http://gamesfromwithin.com/?p=428#co…
Re: I Want My Memory, Apple
#7Earlier quoted context omitted.
Well the way you use memory in a game is non deterministic, so "OS having time to free memory" is not a good enough answer. Although you're totally right that the IPhone wasn't designed as a console, so this process is probably good enough for most apps. Even more interresting than the post in itself (wich is very interresting) is the hack proposed by fishermen21 in the comments - http://gamesfromwithin.com/?p=428#co…
Well the way you use memory in a game is non deterministic, so "OS having time to free memory" is not a good enough answer. Once the memory is made available to the foremost application, it will not be reclaimed by the operating system; As a game author you do not need to attempt to introduce determinism across all allocations, but instead ensure that initial allocations are not so rapid as to outpace the low-memory…
Just curious, can swap space be enabled on a jailbroken iphone?
Re: I Want My Memory, Apple
#8But for now, iPhone applications should implement their own paging system by creating an architecture that allows them to listen to the "applicationDidReceiveMemoryWarning:" message and effectively page parts of itself out of memory and in to flash until needed again.
Are you essentially writing your own MMU? Yes! But that's ok, it's a temporary solution to a temporary problem.
Re: I Want My Memory, Apple
#9I agree with the person writing the article. I'd rather have 16 MB of guaranteed RAM available, than maybe 40, or maybe 2. My iPhone app sometimes can't even initialize my tab view controller without crashing depending on the state of the users' iPhone. You can usually get away with using the keyed archiver to page in and out once your app is loaded, but it is typically getting loaded that is the challenge.
Re: I Want My Memory, Apple
#10Earlier quoted context omitted.
Well the way you use memory in a game is non deterministic, so "OS having time to free memory" is not a good enough answer. Once the memory is made available to the foremost application, it will not be reclaimed by the operating system; As a game author you do not need to attempt to introduce determinism across all allocations, but instead ensure that initial allocations are not so rapid as to outpace the low-memory…
The OS does have a VM, it simply does not have swap space allocated to support paging to disk (flash). Paging would introduce a considerably less enjoyable user experience than forcing applications to account for the available RAM. Just curious, can swap space be enabled on a jailbroken iphone?
The iPhoneOS doesn't ship with dynamic_pager, which implements user-space allocation and enabling of page files, but in theory, the necessary kernel support should be available.
Enabling paging to a specific file is done via the macx_swapon syscall:
http://fxr.watson.org/fxr/source/bsd/vm/dp_backing_file.c?v=...
dynamic_pager handles allocation of swap files on-demand (requires free ADC account):
http://www.opensource.apple.com/darwinsource/10.0/system_cmd...