This is the mail archive of the java-patches@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: [cp-patches] [RFA/JDWP] IdManager


On Mon, 2005-06-20 at 10:22 -0500, Archie Cobbs wrote:
> 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;
> 
> Another question born from my own ignorance... :-)
> 
> 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."

?
Keith


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