Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Tmpfs
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Implementations == There are several independent variants of the tmpfs concept. One of the earliest was developed by [[Sun Microsystems]] for SunOS, and other operating systems like the BSDs and Linux provided their own. === SunOS === [[SunOS]] 4 includes what is most likely the earliest implementation of tmpfs; it first appeared in SunOS 4.0 in late 1987, together with new orthogonal address space management that allowed any object to be memory mapped.<ref>{{cite web | url = http://wiki.deimos.fr/images/1/1e/Solaris_tmpfs.pdf | title = tmpfs: A Virtual Memory File System | access-date = 2007-05-07 | author = Peter Snyder }}</ref><ref>{{cite web | url = http://www.sun3arc.org/papers/Perf/SunOS_4.1_performance_tuning.ps.gz | title = SunOS 4.1 Performance Tuning | access-date = 2007-05-07 | author = Hal L. Stern | format = [[GZip]]ped PostScript | archive-date = 2012-02-07 | archive-url = https://web.archive.org/web/20120207050201/http://www.sun3arc.org/papers/Perf/SunOS_4.1_performance_tuning.ps.gz | url-status = dead }}</ref> The [[Solaris (operating system)|Solaris]] {{mono|/tmp}} directory was made a tmpfs file system by default starting with Solaris 2.1,<ref>{{cite web |title=SPARC: Installing Solaris Software |url=http://www.bitsavers.org/pdf/sun/solaris/2.5/802-1959-10_Solaris_2.5_SPARC_Installing_Solaris_Software_Nov95.pdf |publisher=SunSoft |pages=9 |date=December 1992 |access-date=April 23, 2019 }}</ref> released in December 1992.<ref>{{cite web |url=http://www.operating-system.org/betriebssystem/_english/bs-solaris.htm |title=Solaris Operating System (Unix) |work=operating-system.org }}</ref> Output for the Solaris {{mono|df}} command will show ''swap'' as the background storage for any tmpfs volume: # df -k Filesystem kbytes used avail capacity Mounted on swap 601592 0 601592 0% /tmp/test === Linux === tmpfs is supported by the [[Linux kernel]] beginning in version 2.4 (January 4, 2001).<ref>{{cite web |author=Daniel Robbins |author-link=Daniel Robbins (computer programmer) |date=2001-09-01 |title=Common threads: Advanced filesystem implementor's guide, Part 3 |url=http://www.ibm.com/developerworks/library/l-fs3/index.html |archive-url=https://web.archive.org/web/20120203112045/http://www.ibm.com/developerworks/library/l-fs3/index.html |archive-date=2012-02-03 |access-date=2013-02-15 |publisher=IBM DeveloperWorks}}</ref> Linux tmpfs (previously known as '''shm fs''')<ref name=":6">{{cite web |author=Daniel Robbins |author-link=Daniel Robbins (computer programmer) |date=2001-09-01 |title=Common threads: Advanced filesystem implementor's guide, Part 3 |url=http://www.ibm.com/developerworks/library/l-fs3/index.html |archive-url=https://web.archive.org/web/20120203112045/http://www.ibm.com/developerworks/library/l-fs3/index.html |archive-date=2012-02-03 |access-date=2013-02-15 |publisher=IBM DeveloperWorks}}</ref> is based on the ramfs code used during bootup and also uses the [[page cache]], but, unlike ramfs, it supports swapping out less-used pages to swap space, as well as filesystem size and inode limits to prevent [[out of memory|out-of-memory]] situations (defaulting to half of physical RAM and half the number of RAM pages, respectively).<ref>{{cite web | url=https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt | title=tmpfs.txt |author1=Christoph Rohland |author2=Hugh Dickins |author3=KOSAKI Motohiro | access-date=2010-03-16 | publisher=[[kernel.org]] }}</ref> === BSD === [[Berkeley Software Distribution#VAX versions|4.2BSD]] introduced MFS,<ref>{{cite web | url = http://netbsd.gw.com/cgi-bin/man-cgi?mount_mfs++NetBSD-current | title = NetBSD mount_mfs(8) man page | date = 2007-12-08 | access-date = 2013-02-15}}</ref> a memory-based file system implemented by applying the existing [[Unix File System|FFS]] disk filesystem to a virtual memory region. tmpfs, a memory filesystem implemented using conventional in-memory data structures in order to improve on the performance of MFS, was merged into the official [[NetBSD]] source tree on September 10, 2005;<ref>{{cite web | url = http://netbsd-soc.sourceforge.net/projects/tmpfs/ | title = NetBSD-SoC: Efficient memory file-system | author = Julio M. Merino Vidal | date = 2006-02-24 | access-date = 2013-02-15}}</ref> it is available in 4.0 and later versions. [[FreeBSD]] has ported NetBSD's implementation, where it is available in 7.0 and later versions.<ref>{{cite web | url = https://www.freebsd.org/cgi/man.cgi?query=tmpfs | title = FreeBSD tmpfs(5) manpage | author = Xin LI | date = 2013-04-23 | access-date = 2008-12-02}}</ref> [[DragonFly BSD]] has also ported NetBSD's implementation, where it is available in 2.5.1 and later versions. [[OpenBSD]] ported NetBSD's tmpfs implementation as well, initially started by Pedro Martelletto and improved by many others. It was enabled in builds from December 17, 2013.<ref>{{cite web | url = http://marc.info/?l=openbsd-cvs&m=138706370810284&w=2 | title = CVS: cvs.openbsd.org: src - enable tmpfs so it gets tested some more }}</ref> The first release of OpenBSD with tmpfs included was 5.5.<ref>{{cite web | url = http://www.openbsd.org/55.html | title = OpenBSD 5.5 | date = 2014-05-01 | access-date = 2014-05-01}}</ref> OpenBSD 6.0 disabled tmpfs due to lack of maintenance. === Microsoft Windows === In [[Microsoft Windows]], creating files using the {{mono|FILE_ATTRIBUTE_TEMPORARY}} flag will cause file systems to avoid writing data back to non-volatile storage if sufficient cache memory is available.<ref>{{Cite web |last=alvinashcraft |date=2023-02-09 |title=CreateFileA function (fileapi.h) - Win32 apps |url=https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea |access-date=2024-06-27 |website=learn.microsoft.com |language=en-us}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)