This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgcj/25398] .jar files held open twice at runtime
- From: "green at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jan 2006 03:59:45 -0000
- Subject: [Bug libgcj/25398] .jar files held open twice at runtime
- References: <bug-25398-83@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from green at redhat dot com 2006-01-17 03:59 -------
I discovered why we open all jar files twice. It happens in
gnu/java/net/protocol/jar/Connection.java.
While searching jar files, we call
gnu.java.net.protocol.jar.Connection.getJarFile(). The first thing this does
is call gnu.java.net.protocol.jar.Connection.connect().
This, in turn, calls jarFileURLConnection.connect(). jarFileURLConnection is a
gnu.java.net.protocol.file.Connection (if we have a file URL). This opens the
file.
Then gnu.java.net.protocol.jar.Connection.getJarFile() continues. This
special-cases local files, and we end up calling new JarFile([filename]). This
opens the jar file for the second time.
And that's how we end up with two open file descriptors for every jar file we
process. We should probably figure out a way to avoid doing this.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25398