From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19513 invoked by alias); 5 Nov 2008 11:08:21 -0000 Received: (qmail 19366 invoked by uid 22791); 5 Nov 2008 11:08:21 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 05 Nov 2008 11:07:44 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id mA5B7flW002625; Wed, 5 Nov 2008 06:07:41 -0500 Received: from zebedee.pink (vpn-12-150.rdu.redhat.com [10.11.12.150]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id mA5B7dOA011701; Wed, 5 Nov 2008 06:07:40 -0500 Message-ID: <49117E7B.70104@redhat.com> Date: Wed, 05 Nov 2008 11:08:00 -0000 From: Andrew Haley User-Agent: Thunderbird 2.0.0.17 (X11/20080914) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Sylvain_Mari=E9?= CC: java@gcc.gnu.org, mark@klomp.org Subject: Re: [GCJ-core] dynamically unloading native libraries References: <486895.21159.qm@web28503.mail.ukl.yahoo.com> In-Reply-To: <486895.21159.qm@web28503.mail.ukl.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2008-11/txt/msg00022.txt.bz2 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.