jvmti.forceReleaseOnSoftReferences();
jvmti.forceGC();
Map inventory2 = jvmti.produceInventory();
InventoryDataPoint dataPoint = (InventoryDataPoint) inventory2.get(ProducerState.class);
if (dataPoint.getInstances() > 1)
{
// We should only have this producerState... we will look for where are the
// other references
ProducerState originalState = (ProducerState )
((DelegateSupport)p1.getDelegate()).getState();
Object obj[] = jvmti.getAllObjects(ProducerState.class);
for (int i = 0; i < obj.length; i++)
{
if (obj[i] != originalState)
{
log.info("Exploring references on " + obj[i]);
Object[] holders = jvmti.getReferenceHolders(new Object[]{obj[i]});
for (int j = 0; j < holders.length; j++)
{
log.info("Holder[" + j + "] = " + holders[j]);
}
}
}
}
assertTrue("Test produced unexpected objects", jvmti.compareInventories(System.out,
inventory1, inventory2, null, null,
new InventoryDataPoint[]{new InventoryDataPoint(Object.class, 10)}));
}
finally
{
if (conn != null)