public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/25398]  New: .jar files held open twice at runtime
@ 2005-12-13 22:00 green at redhat dot com
  2006-01-17  3:59 ` [Bug libgcj/25398] " green at redhat dot com
  2006-01-29 20:23 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: green at redhat dot com @ 2005-12-13 22:00 UTC (permalink / raw)
  To: java-prs

When I examine gij processes running gcj-dbtool managed code
on Linux with lsof, I see that we have two active file
descriptors for every jar file.  And strace confirms that we
open each jar file twice (and keep them open).   I don't know
why this is happening, but it seems wrong.


-- 
           Summary: .jar files held open twice at runtime
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: green at redhat dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25398


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libgcj/25398] .jar files held open twice at runtime
  2005-12-13 22:00 [Bug libgcj/25398] New: .jar files held open twice at runtime green at redhat dot com
@ 2006-01-17  3:59 ` green at redhat dot com
  2006-01-29 20:23 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: green at redhat dot com @ 2006-01-17  3:59 UTC (permalink / raw)
  To: java-prs



------- 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libgcj/25398] .jar files held open twice at runtime
  2005-12-13 22:00 [Bug libgcj/25398] New: .jar files held open twice at runtime green at redhat dot com
  2006-01-17  3:59 ` [Bug libgcj/25398] " green at redhat dot com
@ 2006-01-29 20:23 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-29 20:23 UTC (permalink / raw)
  To: java-prs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-01-29 20:23 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-01-29 20:23:21
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25398


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-29 20:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-13 22:00 [Bug libgcj/25398] New: .jar files held open twice at runtime green at redhat dot com
2006-01-17  3:59 ` [Bug libgcj/25398] " green at redhat dot com
2006-01-29 20:23 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).