SWAP: HDD vs USB Thumbdrive

I have 1.5GB physical memory right now and is still on the verge of running out everytime i bake a fluid at insanely high resolution (450+).

So my question is which is faster? I have a relative new 512mb thumbdrive that i’d like to use as a swap for linux, if possible. I was under the impression that usb2.0+flash based media is faster than IDE harddrives and therefore makes a better swap, true or false?

Also, would it shorten the life-span of the thumbdrive if i use it as a swap?

And finally, if it’s not faster than IDE HDD, why the hell does Windows Vista has a funtion that allows usb disks to be used as a swap if it’s slower than HDD?

After some quick research…

There are a bunchy-load of different bottlenecks to take into account, but as a rough number, USB 2.0 is throttled at a maximum of 57 megs/s, while ATA is maxing out around 80 MB/s. SATA can sustain considerably higher transfer rates (in the ballpark of 350 MB/s). A hard-drive’s transfer rate is variable depending on what part of the disk is being accessed, and can range from 40 MB/s to 111 MB/s.

So, they’re at least roughly competitive. But swap sucks.

PC3200 (400 mhz DDR) SDRAM can sustain 3.2 gigs per second. It looks like a gig costs about $65 at the moment.

Also, would it shorten the life-span of the thumbdrive if i use it as a swap?

Short answer, yes. Flash memory has finite read/write capabilities. Mean time till failure is something like 1,000,000 read/write operations with current technology, and it’s getting better all the time. It will eventually fail, though.

And finally, if it’s not faster than IDE HDD, why the hell does Windows Vista has a funtion that allows usb disks to be used as a swap if it’s slower than HDD?

Because it’s available?

Thanks for the reply. I did some research after posting the original question and came to the conclusion (according to a FAQ regarding Vista’s thumb-swap function: ReadyBoost) that even though HDD has a higher peak sustaind transfer rate, it simply can’t match the random access speed when compared with flash-based counterparts( i assume it’s beause of the physical nature of a HDD) . therefore flash-based swap WOULD be faster than HDD. But as the life-expenctancy of flash-based drive is severely limited when used as swap, i believe using thumb-drive as swap is, after all, a very temporary, if not foolish solution.

And to justify my original intention: while rams are cheap, and many are significantly faster than 3.2GB/s(DDR2…), I am not planning to touch my PC hardware until Conroe/ddr2/DX10 graphics card comes out in large quantity. And it’s very tempting to utilize the resources at hand(a 512mb flash disk) to give Blender an extra boost when baking fluids.

There are further limitations on Flash memory… It’s not randomly accessible like system RAM.

As a further note, I just polled a couple friends, and I’m hearing that most thumbdrives are only sustaining around 20 megs a second. It’s hear-say, so take it for what it’s worth.

Best of luck!

Edit: Whoops. Looks like most flash drives are NAND, not NOR. That’s a sentence I’d like to never type again.

I think making swap on a flash drive in linux will have completely opposite result than you expect. Flash drives are much more slower than hdds.

What makes the SuperBoost technology useful is that the time to fetch a really small chunk of data from flash is much faster than from hdd because of seeking. So SuperBoost is using the flash as a lookup table/index, but for the real operations it uses hdd.

In Linux there is not such technology and swapping on a flash drive would probably make your distro crawl.

How big is your current swap? If it’s about 2 x your physical memory, you’re hitting the physical possibilities of your computer and nothing else than more real memory won’t help.

Ok, thanks for the clarification. I’ll leave the flash-disk alone for now. I do have 1.5GB of PC3200 and a 2 gig swap on an 160GB IDE harddrive. Baking at 450res for a fluid sim i am working on takes up all the physical mem and 500mb of swap (and that’s running on Gentoo Linux with TWM!)