Process holding /tmp space, need to know the process details


 
Thread Tools Search this Thread
Operating Systems Solaris Process holding /tmp space, need to know the process details
# 1  
Old 04-17-2013
Process holding /tmp space, need to know the process details

Hi ,
In a server /tmp has almost reached 75% and i can see the File system utilization is 48Mb only , so i believe some process is using the /tmp space. I would like to know which process is using /tmp space.
Code:
# df -h /tmp
Filesystem             size   used  avail capacity  Mounted on
swap                    16G    12G   4.1G    75%    /tmp

# du -sh /tmp
  48M   /tmp


This requirement is for a zone , so i am not able to use lsof command. Can someone please tell me if there is any other way to find out which process is using max of /tmp

I know that i can get the process using a mount using fuser command but it does not talk about which process is using max space.

Please help me out on this
# 2  
Old 04-17-2013
Why don't you just see who owns the files in the /tmp directory
Code:
ls -l /tmp

# 3  
Old 04-17-2013
i see lots of files owned by two users but how can come to a conclusion which user and what process intiated by him is using the space
# 4  
Old 04-17-2013
Sometimes I will see stuff owned by aptar, for example. Aptar is application account for the Oracle database on the server.

You may want to look at the logs.
Like /var.log/messages for example.

You can remove most/all the files in the /tmp many of the files could be old and not used.
# 5  
Old 04-17-2013
In my case , the files are consuming only 48Mb of 4G , I do agree that there are lots of files under /tmp but their space utilization is all together 48Mb. Rest of the space is used by some processes , i like to know which process do that ? Since this is a solaris zone , i am not able to use lsof .
# 6  
Old 04-17-2013
Here is a small shell script that will show you some details about all the non empty files currently open in the /tmp file system sorted by processes holding them.
You should easily find the deleted files, if any, that account to the missing space and the script should have no problem running in a zone (untested though).
Code:
#!/bin/ksh
pfiles /proc/* | nawk '
/^[1-9][0-9]*/ {process=$0;next}
/size:0$/ {next}
/'$(sleep 300 > /tmp/.$$ &
pid=$!
pfiles $pid | nawk '/ 1:/ {print $4}'
kill $pid;rm /tmp/.$$)'/ {onTmp=1;finfo=$0;next}
/\// {if(onTmp) printf("%s\n%s\n%s\n",process,finfo,$0);onTmp=0}
/ [0-9]*: / {if(onTmp) printf("%s\n%s (deleted)\n",process,finfo);onTmp=0}
'

Explanations about how the script works is left as an exercise for the reader Smilie

Last edited by jlliagre; 04-17-2013 at 08:18 PM..
# 7  
Old 04-18-2013
Thanks , But i see a kill command in the script , is the script going to kill the top space using process under /tmp ? Well i just want them to be listed ! I dont want to kill them as they are application process
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need iplanet process health runtime details

Hi, I have iPlanet 7.0 process running on Solaris system SunOS mymac15.10 Generic_150400-59 sun4v sparc sun4v. The link here suggests to use the below command to get process runtime details / health inorder to understand if the iPlanet process is hung or good. /usr/bin/ps -o "pid ppid... (4 Replies)
Discussion started by: mohtashims
4 Replies

2. Shell Programming and Scripting

Need generic command to get complete running process details

I am on SunOS and Linux I need generic command to get complete process details from which i will eventually extract socket details (listen address and port) ps -ef | ggrep -i server | ggrep -i mydomaindoes not yield a process that should have both the grep entries along with the listen... (8 Replies)
Discussion started by: mohtashims
8 Replies

3. UNIX for Advanced & Expert Users

How to find process holding a semaphore?

Hello All, The system concerned has multiple processes communicating with each other using shared memory. These processes use semaphores to protect data being used amongst them. The "key" would uniquely identifies the particular semaphore corresponding to a resource for the various processes. ... (2 Replies)
Discussion started by: saptarshi
2 Replies

4. AIX

Need to get process details

Hello, Below are the list of files ls -lrt total 16 lr-x------ 43 oracle dba 0 Dec 5 14:27 root -> / lr-x------ 2 oracle dba 0 Dec 16 00:14 cwd -> /prodoragridcn_01/app/oracle/product/11203/dbs/ -r--r--r-- 1 oracle dba 0 Dec 16... (4 Replies)
Discussion started by: Vishal_dba
4 Replies

5. AIX

Wait process holding CPU

Hi all, Have this performance Issue, srvbd1]root]/]>ps vg | head -1 ; ps vg | grep -w wait PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND 8196 - A 4448:23 0 384 384 xx 0 0 12.8 0.0 wait 53274 - A 4179:28 0 384 ... (9 Replies)
Discussion started by: gopeezere
9 Replies

6. Solaris

How to check which process is holding up the ilde port

HI All Am on Sun OS.While trying to start a process , we could see that the port is idle and we are not able to find the process holding that port. Below is the result we get after using netstat command. lsof command is not yet installed in our machine. netstat -a | grep "port no"... (5 Replies)
Discussion started by: Whiteboard
5 Replies

7. Solaris

Help to trace process consuming more space

Hi all, We have a server having much processes running. It is very difficuilt to trace the exact consuming more memory. Howerver, it shows CPU usage in sequence but how memory? Tried working with TOP command. Please let me know if something not clear. Thanks, Deepak (5 Replies)
Discussion started by: naw_deepak
5 Replies

8. UNIX for Dummies Questions & Answers

How to find the details of the previously running process with PID

OS: Unix or Linux I (only) know the pid of the process which was running earlier (say 5 hrs back) but it is not running now. Is there a way I could find the details of that process? (atleast the name of the process). Please let me know. (2 Replies)
Discussion started by: vijay.d
2 Replies

9. AIX

Paging Space per process

This is my first post, and I am new to the UNIX world. Hopefully this question won't be too lame. I know that I can use topas to see the paging space used by some processes. I would like to script something that can add up the paging space used by process owned by or associated with an... (1 Reply)
Discussion started by: alntht
1 Replies

10. UNIX for Advanced & Expert Users

Process responsible for filling up /var/tmp

Hi, Help ! - I have a process which I cannot find that is writing to /var/tmp every 10 minutes and filling up my partition, it is also filling up my wtmpx file. I have some software error correction for a faulty DIMM at the moment - is this likely to be causing this as well as over-loading my... (3 Replies)
Discussion started by: Mal
3 Replies
Login or Register to Ask a Question