Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Open file handles

Reply
Thread Tools

Open file handles

 
 
D. Alvarado
Guest
Posts: n/a
 
      07-21-2003
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
 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      07-21-2003
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about file handles and windows handles @ Windows Operating Systems eino Python 1 05-08-2007 09:14 PM
Open file handles? Thomas Bartkus Python 3 08-10-2006 02:22 AM
Image file handles left open by aspnet_wp when serving up pages Mike Kiefer ASP .Net 1 09-21-2004 08:30 PM
Integrating FILE * and int file handles Denis Remezov C++ 12 05-11-2004 08:20 PM
Do we just use different file handles when we want to have multiple files open at the same time...? Guy Perl Misc 6 12-08-2003 07:14 PM



Advertisments