classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] [RFA/JDWP] IdManager


From: Archie Cobbs
Subject: Re: [cp-patches] [RFA/JDWP] IdManager
Date: Mon, 20 Jun 2005 13:48:43 -0500
User-agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.3) Gecko/20041129

Keith Seitz wrote:
+  /* Mapping of class (Class) to IDs (ReferenceTypeId) for reference
+     types. Unlike other types, reference id types are NEVER released. */
+  private Hashtable _classTable;

What if a class(loader)s are garbage collected? Would this hash table
then become a memory leak?gets

Yes, but unfortunately, JDWP specifically says that reference type IDs
are never reused, even if the classes are gc'd or unloaded. The same ID
is valid for any reference type for the entirety of the debugging
session. Or at least that's how I interpret this explanation of
"referenceTypeId":

"Uniquely identifies a reference type in the target VM. It should not be
assumed that for a particular class, the classObjectID and the
referenceTypeID are the same. A particular reference type will be
identified by exactly one ID in JDWP commands and replies throughout its
lifetime A referenceTypeID is not reused to identify a different
reference type, regardless of whether the referenced class has been
unloaded."

This seems to only imply that whoever is creating ReferenceTypeID's
must create a new and unique one every time, not that you need to
cache them after the associated class has been unloaded... ?

In any case, how is a class ever going to be unloaded if your
Hashtable is referencing it? :-)

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]