Home » Linux

What is /dev/shm and what is it used for?

25 April 2011 No Comment

What is /dev/shm and what is it used for?/dev/shm is shared memory. It is offered in Linux as a way for memory to be accessed simultaneously by multiple programs.

shm is also known as tempfs or temporary file storage. On Linux it will appear as a mounted file system that you can access directly. Instead of writing to a permanent storage device such as your hard drive, it writes to virtual memory (i.e., it lives in RAM). Since it is memory, anything written to this file system will be removed the next time you reboot.

What is it used for?

The purpose of /dev/shm is to improve the performance of your applications. For example, VMWare server and workstation can use this space for its virtual machines to improve performance.

tmpfs is a file system which keeps its files in virtual memory. It lives in the page cache and on cache.

You can check the content of this file system and see if it is being used.

ls -l /dev/shm

In most cases, it should be empty or contain only a few files.

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.