0

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).

2 Answers 2

1

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

2
  • 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, 2011 at 15:33
  • centoshacker.com looks dead/having problems - I get an http response but the content length is zero.
    – user78916
    Aug 2, 2013 at 8:36
1

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.

3
  • see my comment to ewwhite
    – Omry
    Jul 17, 2011 at 15:33
  • Entering it into /etc/fstab should override the default mount for /dev/shm. Jul 17, 2011 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, 2011 at 15:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .