How do I change the size of the available shared memory on Linux?

root@thor:/home/omry# df -h | grep shm
none                  3.9G  3.9G  1.6M 100% /dev/shm

evidently 4GB is not enough for what I am doing (I need to load a lot of data into shared memory - my machine got 8GB of RAM).

link|improve this question
feedback

2 Answers

up vote 1 down vote accepted

It's a function of the amount of installed RAM by default. It's typically 50% of your physical RAM. Changing sizes will probably require creating a new ramdisk or remounting the existing filesystem with different parameters.

See: http://centoshacker.com/kabir/tuning/tuning-tmpfs-filesystemdevshm-for-centos.html

link|improve this answer
I`m using ubuntu 11.04, and it does not appear to have the tmpfs line in fstab. so there is probably a different way to change that on ubuntu. – Omry Jul 17 '11 at 15:33
Thanks, adding to fstab worked – Omry Jul 17 '11 at 15:49
feedback

Modify one of the tmpfs-specific mount options on /dev/shm in /etc/fstab. See the Mount options for tmpfs section of the mount(8) man page for details.

link|improve this answer
see my comment to ewwhite – Omry Jul 17 '11 at 15:33
Entering it into /etc/fstab should override the default mount for /dev/shm. – Ignacio Vazquez-Abrams Jul 17 '11 at 15:35
Thanks, it worked. I have to accept the other question as an answer as it was the first one. – Omry Jul 17 '11 at 15:50
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.