[cp-patches] [RFA/JDWP] IdManager
Archie Cobbs
archie@dellroad.org
Tue Jun 21 14:10:00 GMT 2005
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
More information about the Java-patches
mailing list