![]() |
Using Micro SD Card as Virtual Ram on Nokia N900?
On the G1 their is the SuperD Hack that uses some of (or all of) the Video Cards Storage as extra Ram... Is it possible and or has it been done on the N900 and since the biult in 32GB Hard Drive is so big is it possible to use the Micro SD Card as Virtual Ram on Nokia N900? This would make it super fast? :cool:
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
mhm?
from nokia's n900 homepage: Quote:
but i have to say that 1GB ram is far more than most of us will ever use. ^^ (except you want to calculate PI with many decimal places... xD) |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Oh so the 1GB virtual total comes standard on the N900?
If so that's GREAT! |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
For those who need more VM, and wish to use their entire MicroSD card for this purpose:
(WARNING: This will erase the entire MicroSD card, or worse, some or all of your internal memory if you mistype the device name.. If you plan to proceed, I recommend that you have some idea what you are doing) In x-term: Code:
sudo gainroot |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
no need to worry about that you're running out of ram too fast. ;) |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
@rewt thats freeking great so I can use my 4GB Micro SD as 4GB of RAM!!!!
That is amazing . . . Imagine if I upgraded to 16GB would the system be able to handle all of it? PS @rewt Thanks for the great info!!!!!! |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
And you may also be able to use swap files instead, which saves wasting all the SD card, e.g: Code:
dd if=/dev/zero of=/media/mmc1/swap1.img bs=1M count=1024 |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
I thought Micro SD was fast????
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
I can't think of many situations where you would be using that much virtual ram and not have significant performance issues due to the system constantly swapping data back and forth (remember 'disk thrashing' on older windows boxes when they started to run out of ram?) Also storage on an SD card will be much, much slower than that on the internal swap area. Due to the prevalence of native code, here should be less need for virtual ram than on other systems - and application binary and shared libraries etc. are often 'loaded' by mapping them into memory as though they were part of a virtual memory pagefile, under normal circumstances no binary executable code would hit your main virtual memory file. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Yeah, this will allow memory hungry apps to at least "run" but not "fast". Still good to know. =)
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
The 10megabytes/sec speed is only achieved with large sequential access. Random writes access, which swapping is, yields less than 1 megabyte/s in most cases, and worst case it degrades to less than 100kbyte/s. SD/mmc storage isn't designed for random access :)
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Be careful with terminology, folks.
o RAM: RAM is always physical RAM. In the N900 there's 256MB of it. o There's no such thing as 'virtual RAM'. o Swap space: Resides in the built-in flash storage (there's 768MB of it on the N900), or could be set up on microSD as well). o Virtual memory: This is (on Linux) the sum of swap and RAM. On the N900 it's 1GB (768+256). Virtual memory is what the applications can potentially use (not considering some limitations added by the kernel). Virtual memory is the only thing applications know about. If you have no swap space allocated, only the 256MB physical RAM, then your virtual memory size would be 256MB. There's no such thing as 'not having virtual memory set up'. You mean _swap_ here. o Swap space is always slower than RAM. Maybe in the future this could change, when/if some of the stuff being worked on in the labs manifests itself. Then maybe we'll have RAM, SD cards, USB sticks, other mass storage, all built from the same magical, non-volatile, super-fast stuff. o Adding swap will not make for a faster device, only for a device which can sustain more applications running at the same time, or using more data, without going down in flames. There was a myth, for a while, that the N800 and N810 would be faster if you enabled swap space. This was only in the imagination - I tested this. And there's no rational reason it should be faster, except in very carefully thought out scenarios that won't happen with normal use. o Adding excessive amounts of swap _will_ make your device slower, eventually. Particularly if you keep your applications (e.g. browser) running at all times. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
@TA-t3: Good info. Sometimes I forget that these things aren't always so clear to everyone...
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
If anyone is curious, I submit that moving your swap to your microsdhc card dramatically increases performance. It offloads swap I/O from the internal MMC, which frees it up for concurrent access (ie. program/library loading).
I created a 512mb slice on my microsd card, and modified the boot scripts to use it instead (excluding the 768mb mmc swap area completely) and the device is significantly more responsive when you have more than a few processes running. :) This should be an option out-of-the-box (assuming the user is fairly warned about being unable to eject the microsdhc card while running). Also note that you need a separate partition; a swap file seems to lock /sbin/swapon (bug?), and in any case you'd lose the ability to mount the vfat partition via USB (filesystem in use). |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
Only optified programs are stored on the eMMC, the same flash chip used for swap. So it should only make a difference in certain very specific circumstances. There is also a question of how the bus works in the N900, for all we know the microSD and eMMC have to contend for the same bandwidth. Obviously that does not explain your positive results of moving the swap to microSD though. I usually find the N900 far more responsive after a reboot anyway, so are you sure you are not mistaking fresh boot speediness for swap speed improvement? If it does help though, why not keep both swap partitions? Surely it being able to stripe between two separate devices should be even faster still? |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
Would the striping idea work? It certainly seems logical. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Speed depends on SD Class class 6 and class 10 are the fastest at the moment but there is only class 6 micro sd cause class 10 was just released
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Good point on rootfs being on a separate partition. I do run a lot of optified apps, and many apps access a lot of files in ~ (though small, still wait in the queue during heavy swap I/O).
My uptime's ~6 days right now and I have 8 apps running, and it's showing no signs of slowing down. Everything is still lightning fast. My microsd card is a 4gb sandisk. Not sure the class, but maybe it is faster at the block size the swap is using. I should check that. I did a quick I/O test with dd/sync, and it seemed to be slightly slower than the internal MMC. I should retest with more granularity. I can write up a howto as soon as I get to the office. :) It's pretty straightforward. I'll also note some program load / switch times for reference and comparison. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
I want to try it.Please someone make a wiki.
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
I can write how to do it. Exist 2 ways to do it. 1. Increase Swap volume on internal flash (eMMC). In this case you will need to copy somewhere all files from internal memory (only from /home/user/MyDocs). 2. use swap on microSD card. In this case you will need to copy all files from your SD card. What do you prefer? |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
I want to use sd card
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
I have used this
dd if=/dev/zero of=/media/mmc1/swap1.img bs=1M count=1024 mkswap /media/mmc1/swap1.img swapon /media/mmc1/swap1.img now a swap file of size 209 mb created in sd card.I want to know do I need run the code every time I reboot the device? What will happen if i remove the sd card? |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Yes the device now feels more responsive and fast.Application opening and closing is seems faster.But need more confirmation.
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
No one interested to try it ??
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
I also had the problem of swapon locking up. Did you have to do something special for that not to happen? (my sd card is FAT formatted, BTW) |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
I have formatted the card from mobile before using it.
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
There's a bug in the stock kernel (or possibly busybox) that breaks swapfiles; best bet is to make a new partition on the microsd card, type 82. It's faster anyway.
The easiest way is to plug your n900 in via USB and partition from a linux host (standard /sbin/fdisk). |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
In this case, "conventional" seek time bottlenecks are eliminated due to the type of memory. Unless something is wrong with implementation, the default swap setup should be pretty much 100% of the speed you can get for "virtual memory". But there are far more factors than "it should work this way". Therefore, if many people are coming up with a much faster swap solution by switching to a class 6 card, maybe we can also see if we can't pinpoint the slow down? (ie. throughput, kernel handling, etc..) |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
I used File Manager to format the card
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
The internal block size is something like 256k, if you write 4k (page size), then write 4K somewhere else, then the emmc/sd must internally read 256k, modify the 4k, write back 256k. This makes emmc/sd behave alot like a hard drive that hates seeks. 256 / 4 is 64, that is, worst case speed is the sequential write speed divided by 64. Or, in the case of a class 6 microsdhc card, the worst case speed is 96 kilobytes/sec. Most swap activity is random I/O. But anyway, even if this was not the case, striping across two devices doubles the bandwidth anyway. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
Sequential raid has no effect on streaming I/O, but allows concurrent yet disparate requests to execute concurrently. Having said all that, I was hoping to reduce disk load on the internal MMC so that its queue would stay more empty. But, someone pointed out that most of the system is on another block device anyway, so it would only affect /home (ie. opt, user files, etc). *edit* I just re-read your post and my response might not make sense. :) I meant that striping across multiple devices increases bandwidth at the cost of slightly increasing access time. Sequential raid has no effect on bandwidth, but can reduce access time in some cases. In our case, striping across two block devices (ie. internal MMC + SD) could help us increase total swap bandwidth. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Hmm.. I wonder if there are any potential performance gains by setting the page size to the MMC / SD block size (if possible) or forcing the kernel to only swap, say, 64 pages at a time. Is it possible the kernel is writing out 4kb pages in separate I/O operations?
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
can we do something wrong with running this scripts? is this more pro or can a noobie dare the same?
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
edit: "mkswap /dev/mmcblk1p1" will erase all data on a sd card ofc. |
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
page-cliuster size is already set to 128k, iirc. It helps at the start, but after some time the swap area has become fragmented enough that swapout becomes more 4k random writes
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Did a test,at first run 30 apps at the same time without sd swap.After that rebooted and created swap in micro sd and run same 3p apps.I noticed that there is a little performance increase.
|
Re: Using Micro SD Card as Virtual Ram on Nokia N900?
Quote:
|
All times are GMT. The time now is 04:01. |
vBulletin® Version 3.8.8