6

Anyone know of a way to list currently open file descriptors in Java as well as the limits on the number of open file descriptors?

The best I've found so far is https://gist.github.com/jtai/5408684, which lets me print the Unix FD system max as well as the current number of open descriptors. I haven't found a pure java way to list the paths/names of the files that are actually open though. I also haven't found a pure java way to list the per process limits on number of open file descriptors.

I'm mainly interested in Solaris and maybe Linux platforms, but pure java is better than having to exec something. I know that I can use pfiles (on Solaris), lsof (on Linux), and ulimit (on both), but I'm looking for something better.

EDIT 1: I'm mainly concerned about the number of open descriptors for the current process/jvm as well as the limits on that jvm. System wide stats and limits is a plus too though.

deuberger
  • 3,578
  • 6
  • 31
  • 33

0 Answers0