06-11-2018, 09:41 PM
Un hasard m'a amené à regarder la taille du répertoire /tmp
mfs : https://www.freebsd.org/cgi/man.cgi?query=mount_mfs
Une comparaison théorique entre ramfs et tmpfs
Code :
root@nanopi-neo:/tmp # less /etc/fstab
/dev/mmcsd0s1 /boot/msdos msdosfs rw,noatime 0 0
/dev/mmcsd0s2a / ufs rw,noatime 1 1
md /tmp mfs rw,noatime,-s50m 0 0
md /var/log mfs rw,noatime,-s15m 0 0
md /var/tmp mfs rw,noatime,-s12m 0 0
Une comparaison théorique entre ramfs et tmpfs
Citation :RAM disks use memory inefficiently; file data exists twice in both RAM disk memory and kernel memory, and RAM disk memory that is not being used by the file system is wasted. RAM disk memory is maintained separately from kernel memory, so that multiple memory-to-memory copies are needed to update file system data.https://www.cs.rit.edu/~vcss544/tmpfs.pdf
Tmpfs uses memory much more efficiently. It provides the speed of a RAM disk because file data is likely to be in main memory, causing a single memory-to-memory copy on access, and because all file system attributes are stored once in physical memory, no additional I/O requests are needed to maintain the file system. Instead of allocating a fixed amount of memory for exclusive use as a file system, tmpfs file system size is dynamic depending on use, allowing the system to decide the optimal use of memory.