Bugs item #823561, was opened at 2003-10-14 10:56
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=823561&group_id=22866

Category: JBossServer
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Kevin Kalmbach (kkalmbach)
Assigned to: Nobody/Anonymous (nobody)
Summary: checking log4j.xml leaves open file descriptors

Initial Comment:
The Log4JService mbean leaks file desriptors when it
checks if the log4j.xml file has been updated.

Theproblem is in the URLWatchTimeTask inner class.
When it does a conn.getLastModified() in the run method
, this opens the file.  Nothing closes it (except the GC).

This becomes a problem when the GC is not running
enough and the java process runs out of file
descriptors, then no more files can be opened and bad
things happen.

My proposed solution is to add a finally block around
the try that is already there and add a
conn.getInputStream().close().  This does close the file.

We have verified this on Solaris 8 and Linux 2.4.

I have included a small test file that shows the problem.  
To run it type java test2 file:///home/you/somefile.txt

It will run through a loop of 100, then sleep forever,
this sleep will give you a chance to look at open files.

To view open files, you can look in /proc/<pid>/fd (on
most *nix systems) or run lsof.

This happens on JDK 1.3.X and 1.4.2


Let me know 
-Thanks
-Kevin

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=823561&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to