Solved

/tmp size

Posted on 1998-02-11
2
526 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
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…

717 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