This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
RE: Array marking
- To: "'Bryce McKinlay'" <bryce at albatross dot co dot nz>, Jeff Sturm <jsturm at sigma6 dot com>
- Subject: RE: Array marking
- From: "Boehm, Hans" <hans_boehm at hp dot com>
- Date: Fri, 28 Apr 2000 16:45:19 -0700
- Cc: minyard at acm dot org, java-discuss at sourceware dot cygnus dot com, "Boehm, Hans" <hans_boehm at hp dot com>
Do we know that if a class becomes unreachable and its loader is
unreachable, we can't still be executing a static method in the class? If
not, then unloading the .so is not safe.
There are probably several other safety issues with unloading libraries.
Another one:
Since Java has unordered finalizers, is there any reason to expect class
finalization to wait until all instances of the class have been finalized?
The garbage collector currently does not ensure that, unless libgcj does
something special to do so. (And I'm not sure what it could do.) The spec
seems unclear about whether it should. (Since I personally think unordered
finalization is a bad idea, I'm the wrong person to speculate what it should
say.)
I would personally avoid calling dlclose() if at all possible. There are
too many ways it can result in breakage. In addition to everything else, it
currently breaks the incremental collector, since some of those data
segments you're unmapping might already have been pushed onto the mark
stack.
Hans
-----Original Message-----
From: Bryce McKinlay [mailto:bryce@albatross.co.nz]
Sent: Friday, April 28, 2000 2:06 PM
To: Jeff Sturm
Cc: minyard@acm.org; java-discuss@sourceware.cygnus.com; Boehm, Hans
Subject: Re: Array marking
...
Currently, yes. It has been suggested that it might be nice to be able to
collect dynamically loaded native classes by unloading the .so they were
loaded from once all classes in it are unreachable. We could implement this
by creating a ClassLoader instance for each .so that gets dynamically
loaded (via Class.forName), and calling dlclose() in its finalizer.
regards
[ bryce ]