?
Solved

/tmp size

Posted on 1998-02-11
2
Medium Priority
?
533 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 300 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

755 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