Open file handles

D

D. Alvarado

Hi,
Is there a call or a series of calls I can make to find out how
many open file handles exist (files opened by the currently running
Java program) at any one time during the execution of my Java program?
I am using JVM 1.4 on Solaris.

Thanks - Dave
 
G

Gordon Beaton

Is there a call or a series of calls I can make to find out how many
open file handles exist (files opened by the currently running Java
program) at any one time during the execution of my Java program? I
am using JVM 1.4 on Solaris.

I hope you only need this for debugging purposes, because there isn't
a platform independent way to get the information and it doesn't seem
like something you should need to do in any normal application.

On Solaris /proc/pid/fd has an entry for each open descriptor held by
the process. Similarly on Linux, but there you can also use
/proc/self/fd from the process in question (determining the pid is
difficult from inside Java).

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,190
Latest member
ClayE7480

Latest Threads

Top