I don't really understand why you would want to put swap onto a ramdisk though, it would surely be better to run with no swap and more main memory, unless I am missing something. The kernel will make the best use of the resources available to it.
On a side note, use of ramdisk with swap and hibernation seems to me a recipe for disaster.
]]>This leads to the problem that when swap is used things crawl to a halt until the swap is full and the OOM killer shoots down a process (in newer kernels it really often finds that broken process and kills that first).
So you're just sitting there unable to do anything usefull until the culprit is killed.
I also never use swap because of this.
]]>Can you still hibernate your Laptop, when you don't have a Swap Partition the size of your RAM?
It depends, the contents of your RAM are compressed before being written to swap, but it's pretty hard to predict the worst case compression ratio that can be obtained.
I hibernate my machine regularly with a swap space being only 49% of my total RAM available and I never have had problems, but my RAM usage is never 100% when I hibernate either, although it typically is above 49% used (without caches and buffers which are dropped on hibernation).
The only thing that has ever "happened" in my usercase is Java->Minecraft getting smootly killed sometime when it leaked and ate RAM like a glutton.
This atleast makes me feel nice about linux managing and saving ones arse efficently
]]>Never mind-- I missed the RAM disk part.
]]>How much RAM do you have? My machine has 8 G and I have *never* used a swap partition. Swap is an antiquated thing on modern hardware.
Only on a desktop. In a large cluster environment with lots of users, 64G is nothing and swap fills pretty quickly.
]]>If you frequently find that you're filling up your RAM, and don't want to create a disk based swap file/partition, I suggest that you switch to lighter applications, and/or install more RAM in your PC.
]]>I used to figure that mounting a ramdisk as swap was worse than useless. However, now that I know a bit more about paging, I'm wondering if having a dedicated ramdisk to act as a page cache would actually be helpful. Is the Linux kernel smart enough not to need this, or would it help make more efficient use of RAM?
]]>