This is the mail archive of the java@gcc.gnu.org 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]
Other format: [Raw text]

Re: [GCJ-core] dynamically unloading native libraries


Sylvain Marié wrote:

> Thank you for putting the topic back on the table,
> 
>> We seem to never even call JNI_OnUnload on the jni libraries.
> 
> That's exactly my point - and also even libraries that do not contain JNI at all
> (simple .so without any relation to java - I know it is not a very useful case but it is
> very simple to test with a dummy .so).
> 
> But the root cause of the problem is a bit more complex: 
> 
> a) As you mentioned, ClassLoaders don't unload unused native libraries when they are finalized.
> 
> but also
> 
> b) ClassLoaders don't even seem to be finalized when they are not used any more.
> (no alive instances, etc.)
> 
> So even correcting a) would not help, we should first try to understand why 
> ClassLoaders are never gc'ed.

Yes.  I can't think of any immediate reason why they aren't: it's a matter
worth investigating.



Andrew.


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