Open file handles

Discussion in 'Java' started by D. Alvarado, Jul 21, 2003.

  1. D. Alvarado

    D. Alvarado Guest

    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
     
    D. Alvarado, Jul 21, 2003
    #1
    1. Advertising

  2. On 21 Jul 2003 07:57:35 -0700, D. Alvarado wrote:
    > 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


    --
    [ do not send me private copies of your followups ]
    g o r d o n . b e a t o n @ e r i c s s o n . c o m
     
    Gordon Beaton, Jul 21, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Kiefer
    Replies:
    1
    Views:
    398
    Mike Kiefer
    Sep 21, 2004
  2. Denis Remezov
    Replies:
    12
    Views:
    3,867
    Denis Remezov
    May 11, 2004
  3. Thomas Bartkus

    Open file handles?

    Thomas Bartkus, Aug 8, 2006, in forum: Python
    Replies:
    3
    Views:
    427
    danielx
    Aug 10, 2006
  4. eino
    Replies:
    1
    Views:
    452
    =?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?=
    May 8, 2007
  5. Guy
    Replies:
    6
    Views:
    141
    James Willmore
    Dec 8, 2003
Loading...

Share This Page