I have a Java application running on Linux with PID 25426. When running lsof -p 25426
, I noticed:
java 25426 uid 420w FIFO 0,8
- java - The process with the open file.
- 25426 - This should be the real PID. If not please let us know what it is by posting the header.
- 420 w - The file descriptor number followed by the mode it was opened with. (Read / write)
- 0,8 - Major minor device identification.
- 273664482 - The inode of the file.
- pipe - A FIFO pipe that is open in your application.
You are not closing all your streams. There are many open file descriptors in read or write mode that are writing to un-named pipes. The most common scenario for this to happen, is when folks use Runtime.getRuntime.exec() and then proceed to keep the streams associated with the process open. You can use the commons IO utils library to close them or you can close them yourself.
try
{
p = Runtime.getRuntime().exec("something");
}
finally
{
if (p != null)
{
IOUtils.closeQuietly(p.getOutputStream());
IOUtils.closeQuietly(p.getInputStream());
IOUtils.closeQuietly(p.getErrorStream());
}
}
If that is not the problem, you'll need to dig into your code base and identify where the leaky streams are and plug them.