Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: ramdisk swap< Next Oldest | Next Newest >
John Offline





Group: Super Administrators
Posts: 697
Joined: Sep. 2003
Posted: May 03 2007,07:42 QUOTE

I've been experimenting with making a swap file in ram and Ive found that it pushes back the lockup point on computers without a swap partition and limited ram -- like my eBox that I use as my home computer.  Usually it locks up at 50% memory usage, but if I create a small swap file it can go all the way up to 90% usage before it locks up.  What's interesting is that I am not able to make a swap partition from within the /ramdisk/ directory.  But it works fine outside of it.

Here is the simple technique:
cd /
dd if=/dev/zero of=swapfile bs=4096 count=500
mkswap swapfile
swapon swapfile

That gives me a tiny swap file of just 2MB.  It doesn't seem like it would make any difference, but I guess this has to do with the way the kernel handles memory allocation.  It seems to get tripped when it hits the point where it would start engaging swap and its not there.
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: May 03 2007,15:19 QUOTE

I never would have thought creating a swap file in ram would have any benefit at all, and in fact I've said that in response to a DSL user wanting to do this quite a while ago. Shows how assuming really can be a bad thing =o)

--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
WDef Offline





Group: Members
Posts: 798
Joined: Sep. 2005
Posted: May 03 2007,21:27 QUOTE

There was a heated thread on this very topic on the kerneltrap.org forum, people arguing either that a ram swap made no sense, and otoh people saying that the linux kernel was designed to find and use swap and so would rather have a ram swap than none at all.

Looks like John's proved which side was right, at least on his system.
Back to top
Profile PM 
meo Offline





Group: Members
Posts: 552
Joined: April 2004
Posted: May 04 2007,18:30 QUOTE

Hi there!

I'm using it now and it seems to work just fine. It seems to save actual ram space so it looks like a good idea.

As always have fun with DSL,
meo


--------------
"Live and let live"   Treat others the way you want to be treated because that's what you should expect from them.

"All that is very well," answered Candide, "but let us cultivate our garden." - Francois-Marie Arouet Voltaire
Back to top
Profile PM 
3 replies since May 03 2007,07:42 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: ramdisk swap

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code