Virtual Memory


thumpgun

Zombie club life member
Joined
Oct 8, 2006
Messages
451
Age
87
Location
front of pc..
Website
Visit site
can or is there a programe wrote that boosts the gp2x performance in the same way as windows xp use's virtual memory to boost its performance ? :huh:
 
I'm not sure how using virtual memory would improve performance. Virtual memory, if I'm correct, is used to handle a shortage of RAM. By using a swap file of sorts on something like NAND or an SD Card, I imagine things would actually go much slower than if it was using RAM. I could be incorrect, so please clarify if I'm wrong. I'm under the assumtion Windows uses it's swap file for the purpose of extending the physical RAM by using the harddrive storage space.
 
I'm not sure how using virtual memory would improve performance. Virtual memory, if I'm correct, is used to handle a shortage of RAM. By using a swap file of sorts on something like NAND or an SD Card, I imagine things would actually go much slower than if it was using RAM. I could be incorrect, so please clarify if I'm wrong. I'm under the assumtion Windows uses it's swap file for the purpose of extending the physical RAM by using the harddrive storage space.
This is exactly correct. In Windows a swap file is on the hard disk which is exceedingly slow compared to main RAM. On the GP2X, if you used the SD card it'd be far slower than RAM, especially with the lack of DMA, but it might be pretty snappy with NAND-- that is, to read from. You would want to write to NAND at a time when there is not much going on, because it's going to take a little while compared to reading it.
 
Last edited by a moderator:
This is exactly correct. In Windows a swap file is on the hard disk which is exceedingly slow compared to main RAM. On the GP2X, if you used the SD card it'd be far slower than RAM, especially with the lack of DMA, but it might be pretty snappy with NAND-- that is, to read from. You would want to write to NAND at a time when there is not much going on, because it's going to take a little while compared to reading it.

In fact, linux preemptively swaps things out (maybe only in more recent kernel versions) to swap before RAM fills, just for that performance reason. It makes more sense to have things in swap and RAM at the same time if memory is getting tight - that way the RAM copy can be dumped right away if needed.
 
Last edited by a moderator:
This is exactly correct. In Windows a swap file is on the hard disk which is exceedingly slow compared to main RAM. On the GP2X, if you used the SD card it'd be far slower than RAM, especially with the lack of DMA, but it might be pretty snappy with NAND-- that is, to read from. You would want to write to NAND at a time when there is not much going on, because it's going to take a little while compared to reading it.

In fact, linux preemptively swaps things out (maybe only in more recent kernel versions) to swap before RAM fills, just for that performance reason. It makes more sense to have things in swap and RAM at the same time if memory is getting tight - that way the RAM copy can be dumped right away if needed.

and patches even exists for linux (maintained by con kolivas) to do swap prefetching, which is also quite useful, and costs nothing
 
Last edited by a moderator:
I'm not sure how using virtual memory would improve performance. Virtual memory, if I'm correct, is used to handle a shortage of RAM. By using a swap file of sorts on something like NAND or an SD Card, I imagine things would actually go much slower than if it was using RAM. I could be incorrect, so please clarify if I'm wrong. I'm under the assumtion Windows uses it's swap file for the purpose of extending the physical RAM by using the harddrive storage space.
This is exactly correct. In Windows a swap file is on the hard disk which is exceedingly slow compared to main RAM. On the GP2X, if you used the SD card it'd be far slower than RAM, especially with the lack of DMA, but it might be pretty snappy with NAND-- that is, to read from. You would want to write to NAND at a time when there is not much going on, because it's going to take a little while compared to reading it.

Well, running a swap space from any kind of Flash wouldn't be something that, I think, would be all that good. Flash has a limited number of writes and then, it's done. Plus, for a hand-held, 64mb is quite a lot. And I doubt that the GP2X's Linux (or any other more-or-less "commercial" Linux OS e.g. smart phones) would try to utilize a swap space on a hand-held.
 
Last edited by a moderator:
Aye, GPE can already use a swapfile, but does warn that it will shorten the life of your SD, and with the NAND being basically a small internal sd card, its also limited by number of writes, so using it for swap could brick your gp2x!
 
Back
Top