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 a Comment