TMPFS Introduction
TMPFS is a virtual memory file system, not a block device. is a memory-based file system that does not need to be initialized with MKFS, etc. when created
Its biggest feature is its storage space in the VM (virtual memory), the VM is managed by the VM subsystem inside the Linux kernel.
The size of the VM below Linux is made up of RM (real Memory) and swap, and the size of the RM is the size of the physical memory, and the size of the swap is determined by itself.
Swap is a virtual memory space through the hard disk, as a result, its read and write speeds are much slower than RM (real Memory), and when a process requests a certain amount of memory, as the kernel's VM subsystem discovers that there is not enough RM, some of the infrequently used data in RM is swapped into swap. If you need to reuse the data, swap them from swap to RM. If you have large enough physical memory, you can partition the swap without dividing it.
More about swap: http://blog.csdn.net/haibusuanyun/article/details/16336593 Click on the Open link
The VM consists of two parts of Rm+swap, so the maximum storage space for TMPFS is up to (the size of RM + the size of Swap). But for TMPFS itself, it doesn't know whether the space it uses is RM or swap, which is managed by the kernel's VM subsystem.
Tmpfs default size is half of RM, if your physical memory is 1024M, then tmpfs default size is 512M
Typically, it is configured to be smaller than the physical memory size.
The size of the TMPFS configuration does not really occupy this block of memory, if the/dev/shm/without any files, it occupies the memory is actually 0 bytes, if it is the largest 1G, there are 100M files, the remaining 900M can still be used for other applications, However, the 100M of memory it occupies will not be reclassified by system recycling.
When you delete a file in Tmpfs, the Tmpfs file system driver dynamically reduces the file system and frees the VM resources.
#########################