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?
My suggestion is to use strace for further investigations:
This will report all opening and closing of files to the file
/tmp/trace
, e.g.