Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This question already has an answer here:

lsof -n contains thousands of entries like this:

COMMAND     PID       USER   FD      TYPE             DEVICE  SIZE/OFF       NODE NAME
java      27181       root 5044u     FIFO                0,8       0t0  359768953 pipe
java      27181       root 5045u     0000                0,9         0       4734 anon_inode
java      27181       root 5046u     FIFO                0,8       0t0  359781352 pipe
java      27181       root 5047r     FIFO                0,8       0t0  359798491 pipe
java      27181       root 5048u     FIFO                0,8       0t0  359768702 pipe
java      27181       root 5049u     FIFO                0,8       0t0  359771810 pipe
java      27181       root 5050u     FIFO                0,8       0t0  359771810 pipe
java      27181       root 5051u     0000                0,9         0       4734 anon_inode
java      27181       root 5052u     0000                0,9         0       4734 anon_inode
java      27181       root 5053u     0000                0,9         0       4734 anon_inode
java      27181       root 5054u     FIFO                0,8       0t0  359778526 pipe
java      27181       root 5055u     FIFO                0,8       0t0  359798491 pipe
java      27181       root 5056u     FIFO                0,8       0t0  359828660 pipe
java      27181       root 5057u     0000                0,9         0       4734 anon_inode
java      27181       root 5058u     FIFO                0,8       0t0  359778518 pipe
java      27181       root 5059u     FIFO                0,8       0t0  359778518 pipe
java      27181       root 5060u     FIFO                0,8       0t0  359828660 pipe
java      27181       root 5061u     0000                0,9         0       4734 anon_inode
java      27181       root 5062u     0000                0,9         0       4734 anon_inode
java      27181       root 5063u     FIFO                0,8       0t0  359778520 pipe
java      27181       root 5064u     FIFO                0,8       0t0  359778520 pipe
java      27181       root 5065u     0000                0,9         0       4734 anon_inode
java      27181       root 5066u     FIFO                0,8       0t0  359781378 pipe
java      27181       root 5067u     FIFO                0,8       0t0  359843851 pipe
java      27181       root 5068u     FIFO                0,8       0t0  359828693 pipe
java      27181       root 5069u     FIFO                0,8       0t0  359831577 pipe
java      27181       root 5070u     FIFO                0,8       0t0  359781378 pipe
java      27181       root 5071u     0000                0,9         0       4734 anon_inode
java      27181       root 5072u     0000                0,9         0       4734 anon_inode
java      27181       root 5073u     0000                0,9         0       4734 anon_inode
java      27181       root 5074u     0000                0,9         0       4734 anon_inode
java      27181       root 5075u     FIFO                0,8       0t0  359943483 pipe
java      27181       root 5076u     0000                0,9         0       4734 anon_inode
java      27181       root 5077u     FIFO                0,8       0t0  359835297 pipe
java      27181       root 5078u     FIFO                0,8       0t0  359932954 pipe
java      27181       root 5079u     0000                0,9         0       4734 anon_inode
java      27181       root 5080u     FIFO                0,8       0t0  359940230 pipe
java      27181       root 5081u     0000                0,9         0       4734 anon_inode
java      27181       root 5082u     FIFO                0,8       0t0  359835267 pipe
java      27181       root 5083u     FIFO                0,8       0t0  359838075 pipe
java      27181       root 5084u     FIFO                0,8       0t0  359895241 pipe
java      27181       root 5085u     FIFO                0,8       0t0  359843844 pipe
java      27181       root 5086u     FIFO                0,8       0t0  359828661 pipe
java      27181       root 5087r     FIFO                0,8       0t0  359787185 pipe
java      27181       root 5088w     FIFO                0,8       0t0  359787185 pipe
java      27181       root 5089u     FIFO                0,8       0t0  359840961 pipe
java      27181       root 5090u     0000                0,9         0       4734 anon_inode
java      27181       root 5091u     FIFO                0,8       0t0  359835297 pipe
java      27181       root 5092u     FIFO                0,8       0t0  359828661 pipe
java      27181       root 5093u     0000                0,9         0       4734 anon_inode
java      27181       root 5094u     0000                0,9         0       4734 anon_inode
java      27181       root 5095u     FIFO                0,8       0t0  359835267 pipe
java      27181       root 5096u     FIFO                0,8       0t0  359838075 pipe
java      27181       root 5097u     FIFO                0,8       0t0  359840961 pipe
java      27181       root 5098u     0000                0,9         0       4734 anon_inode
java      27181       root 5099u     0000                0,9         0       4734 anon_inode
java      27181       root 5100u     FIFO                0,8       0t0  359843851 pipe
java      27181       root 5101u     FIFO                0,8       0t0  359895241 pipe
java      27181       root 5102u     0000                0,9         0       4734 anon_inode
java      27181       root 5103u     FIFO                0,8       0t0  359843710 pipe

Looks like our java service is leaking some handles. How to find out what is causing this? Is it handles to real files or something else?

share|improve this question

marked as duplicate by quanta, Khaled, Dave M, Scott Pack, TheCleaner Feb 20 '13 at 18:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
whoa ls /proc/27181/task/ | wc -l shows 12852 threads –  Poma Feb 20 '13 at 10:44

1 Answer 1

up vote 1 down vote accepted

My suggestion is to use strace for further investigations:

  strace -e trace="open,close" -o /tmp/trace  -v java -version

This will report all opening and closing of files to the file /tmp/trace, e.g.

[...]
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
close(3) 
[...]
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.