Skip to content

Instantly share code, notes, and snippets.

@mondain
Last active July 19, 2018 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mondain/b9963d20c77b12fd79f40f878ab27fcf to your computer and use it in GitHub Desktop.
Save mondain/b9963d20c77b12fd79f40f878ab27fcf to your computer and use it in GitHub Desktop.
Java File Handles

When we run our Java based server on Linux on certain bare-metal servers we're seeing what may be some sort of file handle leak. To give more detail to this question, what would cause additional handles to be consumed outside of file access and socket creation? To get a total count we use lsof -i -n -p JAVA_APP_PID | wc -l to see the entire listing, we use lsof -i -n -p JAVA_APP_PID. On the listing there are entries like these that we don't recognize:

java     30464 mondain    0u      CHR             136,18      0t0       21 /dev/pts/18
java     30464 mondain    1u      CHR             136,18      0t0       21 /dev/pts/18
java     30464 mondain    2u      CHR             136,18      0t0       21 /dev/pts/18
java     30464 mondain  196u     unix 0x0000000000000000      0t0  5488165 type=STREAM
java     30464 mondain  200r     FIFO               0,10      0t0  5491231 pipe
java     30464 mondain  239u  a_inode               0,11        0     9026 [eventpoll]
java     30464 mondain  240r     FIFO               0,10      0t0  5491912 pipe
java     30464 mondain  241w     FIFO               0,10      0t0  5491912 pipe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment