Using Fedora 9's default installation configuration, the "temp directory" (using another OS's terms) is utilized as /tmp. This special directory is a shared file system and resides in memory known as tmpfs.
Problem:
The default settings for a tmpfs is half of the available memory.
Constraints:
Fedora 9's default set up uses an in-memory solution for /tmp.
Details:
My system has 2 gigabyte of memory. However, the average usage for /tmp on my machine is less than one 1 megabyte. So, more then 1023 megabytes of memory was allocated and never used.
Solution:
I needed to control the size of the /tmp. This is mounted at boot time using the description in /etc/fstab. After a forum search, I looked at the man page for the mount command to determine the need to use the size option during mount /tmp. I decided to try only having 2 megabytes for /tmp.
Original /etc/fstab:
New fstab:tmpfs /dev/shm tmpfs defaults 0 0
tmpfs /dev/shm tmpfs defaults,size=2097152 0 0
After making these changes as super user or root, I rebooted my system to get th e settings to become active.
References:
- http://en.wikipedia.org/wiki/TMPFS
- http://en.wikipedia.org/wiki/Fstab
- http://linux.die.net/man/8/mount
- http://forums.fedoraforum.org/forum/showthread.php?t=173821&highlight=change+%2Fdev%2Fshm+size
Note:
The other options for providing /tmp are:
- disk based /tmp, mounting (via /etc/fstab) a disk partition at boot time (preferred)
- directory based /tmp on the boot root partition (not preferred for security reasons)
Disclaimer:
This solution worked for me. It may or may not work for you. I am not responsible for your actions nor the your results of your actions should you act on what you read here. I do not claim expertise in this very specific area and only convey my experience. There is no warranty on this (and most) free information.
Followup (July 26, 2009):
A simpler way to control the /tmp size through the /etc/fstab is using a percentage:
In fstab:
tmpfs /dev/shm tmpfs defaults,size=10% 0 0