This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Array marking


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 ]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]