[Mogul, XV6800 General] pflatlyne:
That Microsoft article says the same thing I said a year or so ago with one difference. They say that you cant use a removable storage device for a paging file which is a 100% incorrect statement. The reality is,you CAN use it for a paging file,but if you remove it,the device could crash. If you were willing to risk that,or more accurately,know you cant remove the memory card.there is no reason at all that you could not use the SD card for paging. I certainly see why MS does not want to waste time on that feature. it would be turned off by default on all phones,because Sprint cant sell a phone that would lock up when you changed the card out. (Actually,that may not be entirely true. On some phones,like the blackberry,the card is hidden behind the battery. You cant change the card without removing the battery ,so the problem is solved) There is really no reason why a phone cannot doing paging just like your desktop PC. You wouldn't want to,but that's for other reasons. The reason you don't WANT to is because on your computer,you DO page code as well as data. The CPU has virtual memory hardware that divides up the address space of the CPU into pages and maps physical memory into it.

It works like this. Most memory references tend to cluster within the same page. Occasionally,you cross a page boundary. When that happens the paging hardware decides if the page you have just accessed is in physical memory or not. If its loaded,it just goes on executing. If its not loaded,it hands off control and loads the page,then resumes where it left off in the newly loaded page. On your PC it does not really matter if this is code or data.

On your phone,program code is all stored in ROM. If you release that page,but later need it again,it will always be faster to load it from the ROM than to load it from the flash card. All you want to page out is data,or programs that are not loaded from ROM,but instead loaded from the flash card. In fact,you don't even want to put them in the paging file,because its as fast to reload them from where they are stored,and you don't have to take the time to write them out.

But it would wear out the flash drive,right? Well,perhaps. The data that's paged out changes,and it changes a lot,but maybe there are ways to minimize it. As an example,say a program creates 20 pages worth of data. 20 pages are then written to the flash card.One of the pages changes,rather than overwrite that page,a new pages is written to a free spot on the card,and the page table is updated. What is a free spot on the card? Its the page in the paging file that is oldest. (Has not been written to for the longest time) Presumably,each time you free a page,its location would be placed on a FIFO stack. Each time you needed to write a page,you would get he value of the next oldest unused page on the flash card. Additionally,you could set some sort of stability criteria for pages to be written out. Pages that change more might be written out less. Perhaps pages that change more than a certain number of times per some interval would,rather than paging out to the card,be loaded to ram and stay there. Essentially,the OS would decide which pages were placed on the storage card, in an intelligent way intended to optimize the delay on page misses,as well as minimize writes to the card.