tmpfs

Tmpfs (English for temporary file system ) is a file system that is used in many Unix -like operating systems as an improved substitute for a RAM disk. In contrast to the RAM disk, used in the real memory is used in tmpfs virtual memory instead of the hard drive as memory.

Function

Everything is stored in tmpfs is temporary, since it is not stored on the hard drive, and is no longer available after a restart. The advantage of tmpfs is its speed: From the main memory can be much faster than can be read and written from the disk. For this reason, the temporary directory / tmp is often realized with it. The directories / var / run and / var / lock are often generated by these systems in order to avoid a clean up at every reboot.

The memory used by tmpfs grows and shrinks depending on the files contained therein, and can be swapped out to swap space.

Many Unix distributions use tmpfs by default for the / tmp branch of the file system or shared memory. This can be understood by the df command:

Filesystem Size Used Avail Use% Mounted on Verw tmpfs 256M 688K 256M 1% / tmp implementations

SunOS / Solaris

SunOS and Solaris later include one of the earliest implementations of tmpfs where it was from version 4.1 use, which was published in March 1990. Since Solaris 2.1 is / tmp by default a tmpfs file system. The df command displays as a background memory correctly " swap", regardless of what was specified in the mount command as a backing store, as this parameter is ignored by mount_tmpfs.

# Df -k File System 1K - blocks Used Avail Verw % Mounted on swap 601592 0 601592 0% / tmp / test Linux

The Linux kernel provides tmpfs ready since version 2.4. Tmpfs (formerly known as shmfs ) differs from a Linux RAM disk in so far as memory is allocated dynamically and less used pages can be swapped out to swap space. (Which can both advantages and disadvantage to be), however ramfs uses no virtual memory. Tmpfs can dynamically up to a specified maximum size ( set to half of the available RAM ) grow and always occupies only as much memory as is needed. The limit can be changed by using options or, for example by the command mount-t tmpfs -o size = 1G, nr_inodes = 10k, mode = 0700 tmpfs / space, and which has a maximum size of 1 GiB with a maximum of 10240 inodes exclusive access for the owner of the file system / space allowed. The limit may be in operation about by the command mount-o remount, size = 2G / space be changed. If the limit is too large and not enough swap space is available, there are problems.

BSD

Tmpfs is included in the official NetBSD sources 10 September 2005 and is usable since version 4.0. For the implementation of FreeBSD NetBSD has been ported and is available since version 7.0.

On systems with low memory, the use of large temporary data in memory lead to instabilities.

Microsoft Windows

Windows has with " Temporary files " a similar concept. Files that were created with the flags FILE_ATTRIBUTE_TEMPORARY and FILE_FLAG_DELETE_ON_CLOSE be held in memory and only written to disk when the system has enough memory available. So it behaves like tmpfs, with the difference that the files are written to a specific folder instead of in the swap area.

632974
de