Solved

/tmp size

Posted on 1998-02-11
2
519 Views
Last Modified: 2012-05-04
Have a Ultra 3000 w/Sol 2.5.1 on it.  Getting /tmp file system full every now and again.  When I look at /tmp, sure enough, it's 100% full, but the overall size of /tmp has been decreases from some 600M to 88K!  When I remove some files from /tmp, the overall size goes down 33K!  /tmp is mounted on swap.  I'm going to take a stab and say that a process is writing to swap or /tmp.  If this sounds like the case, how do I tell what that proc is?  If this is not the case, pls help me see the light!!!!
0
Comment
Question by:terryt121697
2 Comments
 
LVL 3

Accepted Solution

by:
dhm earned 100 total points
ID: 2008810
On Solaris 2.5.1 (& earlier, but I don't know how far back) /tmp is basically a ramdisk.  It uses system RAM, and swap, to hold files.  However, the tmpfs filesystem isn't the only thing using system RAM/swap space; all the programs running use that space too.  When you have a lot of progs running, or they're using up a lot of space, the capacity of your /tmp is reduced accordingly.  (Also, if you have a lot of stuff in /tmp, the amount of virtual memory available to processes is reduced.)

When you start having problems, look for big files in /tmp (use "ls -l") and big processes (use "ps -el" or "ps -alx"; the size of the process is reported in the "SZ" column).  That will allow you to find the culprit in most cases.  One case that escapes, though, is when a program creates a file in /tmp, then deletes it, but keeps a handle to the file and continues to write to it.  This will gobble up space in /tmp, but you won't be able to see the file when you do "ls -l".  I think you can detect that this is happening by comparing the output of the commands "du -s /tmp" and "df /tmp".  Du gives you the number of blocks (or kbytes or something) in files that are in /tmp; df gives you the absolute partition usage.  The du number should be about the same as the df "Used" number (or about half/twice as much, if one or the other reports in 512-byte blocks instead of kbytes).  If the numbers are significantly different, you may have an "invisible" file (caused as I described above).  If you suspect that you have such a file, you can use "fuser -c /tmp" to get a list of all process IDs that are using /tmp for any reason (e.g. they have an open file there, /tmp is their current directory, etc.)  Then you can do "fuser /tmp/*" to get a list of processes using each file in /tmp.  Any processes listed in the first list with "o" after their ID but not listed in the second list have open handles to files that have been deleted.
0
 

Author Comment

by:terryt121697
ID: 2008811
Thanx, it was the proc writing to /tmp and keeping the handle.  That is why I couldn't see em'.  For now, I have increased /tmp and will fire off an e-mail to the programmers.  Thanx.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question