News for hackers. Stuff that matters.
Re:I Want My Memory, Apple by ankhmoop on Thursday May 07, 2009 @02:03PM (#598364)
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 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 by kqr2 on Thursday May 07, 2009 @02:08PM (#598374)
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?

Re:I Want My Memory, Apple by ankhmoop on Thursday May 07, 2009 @02:28PM (#598414)
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...

Re:I Want My Memory, Apple by Tichy on Friday May 08, 2009 @03:37PM (#600129)
In a way, why does it matter if it has paging or not? Either way the total memory available is limited (hard disks don't have infinite storage space).
Re:I Want My Memory, Apple by barrkel on Thursday May 07, 2009 @11:37PM (#599123)
Yes. Instead of the "less enjoyable" experience of paging, we have the totally appletastic experience of disappearing applications, without warning.