On Ubuntu 18.04, When I run
$ df -h,
I see this result:
Filesystem Size Used Avail Use% Mounted on
...
tmpfs 3,9G 73M 3,8G 2% /dev/shm
...
/dev/shm has a 3.9G size.
How could I change the size of /dev/shm?
/dev/shm is a temporary file storage filesystem (see tmpfs ) that uses RAM for the storage. It can function as shared memory that facilitates IPC. It is a world-writeable directory. The size of /dev/shm is limited by excess RAM on the system, and hence you're more likely to run out of space on this filesystem.
/dev/shm is nothing but implementation of traditional shared memory concept. It is an efficient means of passing data between programs. One program will create a memory portion, which other processes (if permitted) can access. This will result into speeding up things on Linux.
One time resize:
$ sudo mount -o remount,size=8G /dev/shm
/etc/fstab (with sudo if needed).none /dev/shm tmpfs defaults,size=4G 0 0.Case 1 - This line exists in your /etc/fstab file:
size=. For example if you want an 8G size, replace size=4G by size=8G.sudo if needed) $ mount -o remount /dev/shm.Case 2 - This line does NOT exists in your /etc/fstab file:
none /dev/shm tmpfs defaults,size=4G 0 0, and modify the text after size=. For example if you want an 8G size, replace size=4G by size=8G.sudo if needed) $ mount /dev/shm.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With