tempfs vs RAM Disk

October 21, 2004

I am beginning to wonder why I ever bothered with RAM disks. Apprently tempfs can offer all the benefit of RAM disk and more.

For years I used to think /dev/shm that used to show up with a call to df was just for shared memory. How stupid can you get?! according to the kernel documentation, it probably isn't even used for shared memory nowadays!

It turns out that you can mount /dev/shm and use it just like any other partition. The main advantage it has over RAM disks is that you can change it's size dynamically and if by some chance you need it to be larger than the available RAM you can move it out into swap.

The first thing I did since making this discovery is to move my /tmp into shared memory. All it takes is the following entry in /etc/fstab
none /tmp/ tmpfs size=32M,nr_inodes=10k,user,noatime 0 0

That gives me a 32mb /tmp folder.


Posted by raditha at October 21, 2004 1:16 PM
Your Ad Here

 

Jabber  |  Linux  |  mySQL  |  PHP  |  Java  |  Site Map  |  Wiki

Downloads  |  About  |  Links  |  Contact  |  Home

 

Copyright © Raditha Dissanayake 2003 - 2007

Terms of Use  |  Privacy

 

 

October 2004
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31