>>| Since RAM is cheap I was thinking of using 64MB of my 256MB RAM as swap space
>>| probably by means of ramdisk. This is especially beneficial when used on a
>>| diskless client to avoid using the inefficient NFS-SWAP.
>>| How do I then configure the RAM to turn some portion of it into ramdisk for
>>| this purpose?
>>Use ram to simulate a disk simulating ram?
>>Just use it as normal memory.
> In a diskless Linux PC it is required to have some SWAP space.
> Otherwise, the system hangs when it runs out of memory.
Quote:> The presence of SWAP space avoids this problem, so a workaround is
> to use ramdisk for SWAP space since there's no local hard drive.
If there _WAS_ such a problem, the "faking swap from ramdisk" strategy
would merely make it occur earlier.
Think about it.
Supposing your system has 256MB of RAM, and when you run out of VM
(which is nonsense), the system will hang.
Alternative #1. All 256MB of RAM being treated as "real memory."
The system would "fall over" when 256MB of RAM got used up.
Alternative #2: 128MB of RAM gets turned into a "ramdisk" used as
Total virtual memory will be 128MB (the amount left) + slightly less
than 128MB of RAM (because there's overhead in creating a ramdisk).
Again, the system has 256MB of virtual memory (128MB + 128MB), and the
system would "fall over" when 256MB of RAM got used up.
The two alternatives don't differ.
Supposing there _were_ a "system hangs when it runs out of memory"
problem, you haven't provided a strategy that does anything to help.
In fact, the system will be working harder under Alternative #2
(because it's jumping through added hoops to treat the ramdisk as
"pretend VM"), and would hang _earlier_.
"For systems, the analogue of a face-lift is to add to the control
graph an edge that creates a cycle, not just an additional node."
-- Alan Perlis