Search:  
Gentoo Wiki

Gentoo:/dev/shm

This directory is part of the Gentoo Structure index.
Parent Directory Children Related Links

About

/dev/shm is the implementation of the shared memory concept. Its goal is to speed up applications. By default /dev/shm will uses your RAM. Therefore it's much faster than storing your data in any other path. Note, shared memory is only temporary. It is basically a file system that stores all files in virtual memory and therefore, no files will be created on your hard drive. It behaves like /tmp/. Both use the tmpfs file system (shmfs is the same as tmpfs). If you type in the following command, you will be able to see the size of /dev/shm and the space left:

 # df -h

If you type the command

 # mount
 ...
 shm on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)
 ...

you will see, that /dev/shm uses the tmpfs. It will also show the options /dev/shm has been mounted.

Using /dev/shm

/dev/shm will help you to improve the performance of your software. It's useful especially if you need to write a file temporarily and need to access it quite often. This might be the case for big websites. It's also a good idea to use /dev/shm for caching. If you think, your /dev/shm-device is too small for your needs and your RAM isn't fully used, you can remount /dev/shm to make it use more space.

 # mount -o remount,size=4G /dev/shm

Note: This requires you to have at least 4 GB of RAM.

Retrieved from "http://www.gentoo-wiki.info/Gentoo:/dev/shm"

Last modified: Tue, 10 Jun 2008 03:57:00 +0000 Hits: 1,492