Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 1219 invoked from network); 29 Jul 2006 22:05:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Jul 2006 22:05:41 -0000 Received: (qmail 11639 invoked by uid 500); 29 Jul 2006 22:05:38 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 11596 invoked by uid 500); 29 Jul 2006 22:05:37 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 11585 invoked by uid 99); 29 Jul 2006 22:05:37 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Jul 2006 15:05:37 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of nbeyer@kc.rr.com designates 24.94.166.115 as permitted sender) Received: from [24.94.166.115] (HELO ms-smtp-01.rdc-kc.rr.com) (24.94.166.115) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Jul 2006 15:05:36 -0700 Received: from LITTLEGUY (CPE-24-31-248-236.kc.res.rr.com [24.31.248.236]) by ms-smtp-01.rdc-kc.rr.com (8.13.6/8.13.6) with ESMTP id k6TM5EYC019767 for ; Sat, 29 Jul 2006 17:05:15 -0500 (CDT) From: "Nathan Beyer" To: Subject: RE: Re: [drlvm] string interning in java Date: Sat, 29 Jul 2006 17:05:07 -0500 Message-ID: <000901c6b35b$0e538bf0$0c01a8c0@LITTLEGUY> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-reply-to: X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Thread-index: Acay+bnGpOqG075vQvKDRUusxYp6UAAYDfuw X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N > -----Original Message----- > From: Robert Lougher [mailto:rob.lougher@gmail.com] > Sent: Saturday, July 29, 2006 5:28 AM > To: harmony-dev@incubator.apache.org > Subject: Re: Re: [drlvm] string interning in java > > On 7/29/06, Nathan Beyer wrote: > > > > > > > -----Original Message----- > > > From: Robert Lougher [mailto:rob.lougher@gmail.com] > > > Sent: Friday, July 28, 2006 7:40 PM > > > To: harmony-dev@incubator.apache.org > > > Subject: Re: Re: [drlvm] string interning in java > > > > > > Hi, > > > > > > On 7/29/06, Alex Blewitt wrote: > > > > On 28/07/06, Salikh Zakirov wrote: > > > The interned String table should be garbage-collected. If the only > > > reference to an interned String is from the class constant pool it > > > will be collected when the class is unloaded. If the intern table is > > > preventing Strings from being collected it's a bug in the VM! > > > > Can the String from a class constant pool be collected if the class is > still > > in use? I'm assuming it can't, so the above is an incomplete response to > > Alex's points, as I imagine it's very possible to have many Strings in > > constant pools that are never or rarely used, but the class objects are > used > > quite frequently and would never get collected. For example, the Strings > > used in exceptions that rarely, if every get called in some classes. > > > > It wasn't meant to be a complete response. I was responding to the > following point: I meant that your response to that point was incomplete and I still believe it is. > > > > > Furthermore, because it's a > > > > dynamically read in string, it doesn't pollute the intern() pool, > and > > > > thus when the class is unloaded, the string is unloaded too. Once a > > > > String is intern()'d, it's like a memory leak -- you'll never see > that > > > > memory again. > > Which implies that freeing of the dynamically loaded string when the > class is unloaded is something special. It is not. Nor is an > interned string a memory leak. It will be collected when there are no > more references to it like any other object. > > Rob. This assumes that Classes will frequently get unloaded, which I don't believe is the case, especially classes that are part of the core JRE libraries. Any String that's been placed into the constant pool of a Class couldn't be collected until that Class is collected, correct? And all of the Strings in the constant pool are taking up memory, correct? So, if you have a class and the only Strings in the constant pool are those that represent exception messages or keys to exception messages and those exceptions rarely get executed, but the Class is frequently used (keeping it from being collected), then you'd, theoretically, be wasting memory, correct? -Nathan --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org For additional commands, e-mail: harmony-dev-help@incubator.apache.org