Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Apple's handling of read-only code pages is a departure from the convention in *nix systems, which typically do NOT support re-loading of code pages from the executable file. Instead, iPhone OS is more similar to how Microsoft Windows does things. In traditional *nix systems, there is no distinction between code and data pages in handing virtual memory - BOTH are written-out to backing store when pages are discarded, and code is never re-loaded from the original file. (One positive side-effect of this is that *nix systems are easy to hot-update, as there isn't the concern about changing an executable file while the application is running as there is under Windows.)

I believe that Unix (and Linux) systems have behaved like this for many years now. At least since the 90's. Page in code from an executable only as needed, and if there is memory pressure it can just discard a code segment, since it can access it from it's file at any time (assuming disk doesn't get pulled out, or die). It is only malloced memory that needs to get moved to swap. And with mmaped files, it can just be flushed out to the file if necessary, not to swap.

The mechanism that Unix uses to handle replacing an executable works well with how the filesystems work. You can unlink a file, and it is removed from the directory. But as long as the file remains in use (such as it is running), it remains on the hard drive. So it can be replaced, and the next time the program is run, it is the new copy run.

The 2 main reasons that the iPhone probably doesn't support paging are what is mentioned here, wearing of flash, and most likely performance. Overcommit too much, and performance goes down hill fast. And I bet that it would hurt battery life too.
 
On the subject of why Apple didn't just put more memory in I think answer lies in the way that they integrated the 256MBs of memory into the same chip as the A4 processor. This would make adding memory much more difficult and expensive than if they'd used off-the-shelf memory chips. I suppose the next question is why did they integrate the memory so tightly? My guess is that they wanted to reduce the number of separate components. This would reduce costs and allow the A4 to be easily used in the next iPhone. Integrating the memory may also improve the bandwidth between the processor and the memory.

I've heard about this. From what I read though (and that by no means makes it true) it seems that putting 512 in instead of 256 would take up no additional space and would not cost much more at all. Considering the insane profit margins Apple currently makes with the iPad, I feel like it would make sense to take a tiny hit just to improve one of the most critical aspects of the hardware.

The pessimist in me thinks they did it just so that you'll have to buy the next generation model.
 
Got this error today copying a file. I think it might be the app tho. Going to shoot the dev an email.

21oo09.jpg
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.