7.28.2010

/tmp on Solaris 10

On Sun Solaris 10, /tmp is a tmpfs type file system.  It is supposed to make reads/writes to the temp filesystem fast, but there are some caveats:
 

Swap Space and the TMPFS File System
The TMPFS file system is activated automatically in the Solaris environment by an entry in the /etc/vfstab file. The TMPFS file system stores files and their associated information in memory (in the /tmp directory) rather than on disk, which speeds access to those files. This results in a major performance enhancement for applications such as compilers and DBMS products that use /tmp heavily.
The TMPFS file system allocates space in the /tmp directory from the system's swap resources. This means that as you use up space in /tmp, you are also using up swap space. So if your applications use /tmp heavily and you do not monitor swap space usage, your system could run out of swap space.
Use the following if you want to use TMPFS but your swap resources are limited:
Mount the TMPFS file system with the size option (-o size) to control how much of the swap resources TMPFS can use.
If you are close to running out of swap space, you can use your compiler's TMPDIR environment variable to point to a larger, real directory.
Using your compiler's TMPDIR variable only controls whether the compiler is using /tmp or not. It has no effect on other programs' use of /tmp.