long getIdomId(long instanceId, LongMap.Entry entry) { Long idomEntry = (Long) map.get(new Long(instanceId)); if (idomEntry != null) { return idomEntry.longValue(); } if (entry == null) { entry = heap.idToOffsetMap.get(instanceId); } return entry.getNearestGCRootPointer(); }
long idToDumpOffset(long instanceId) { Entry entry = idToOffsetMap.get(instanceId); return entry == null ? 0 : entry.getOffset(); }
private Long getNearestGCRootPointer(Long instanceIdLong) { LongMap.Entry entry; Long nearestGCLong = (Long) nearestGCRootCache.get(instanceIdLong); Long nearestGC; if (nearestGCLong != null) { return nearestGCLong; } entry = heap.idToOffsetMap.get(instanceIdLong.longValue()); nearestGC = Long.valueOf(entry.getNearestGCRootPointer()); nearestGCRootCache.put(instanceIdLong,nearestGC); return nearestGC; }
int idToInstanceNumber(long instanceId) { Entry entry = idToOffsetMap.get(instanceId); return entry == null ? 0 : entry.getIndex(); }
LongMap.Entry entry = heap.idToOffsetMap.get(instanceId); List refs = entry.getReferences(); Iterator refIt = refs.iterator();
long getRetainedSize(Instance instance) { computeRetainedSize(); return idToOffsetMap.get(instance.getInstanceId()).getRetainedSize(); }
private void writeLeaf(long instanceId, long size) throws IOException { LongMap.Entry entry = heap.idToOffsetMap.get(instanceId); entry.setTreeObj(); entry.setRetainedSize(size); //leavesCount++; if (entry.hasOnlyOneReference()) { long gcRootPointer = entry.getNearestGCRootPointer(); if (gcRootPointer != 0) { LongMap.Entry gcRootPointerEntry = heap.idToOffsetMap.get(gcRootPointer); if (gcRootPointerEntry.getRetainedSize() == 0) { gcRootPointerEntry.setRetainedSize(-1); leaves.writeLong(gcRootPointer); //firstLevel++; } } } }
private long checkInstance(long instanceId, Instance refInstance) throws IOException { if (refInstance != null) { LongMap.Entry refEntry = heap.idToOffsetMap.get(refInstance.getInstanceId()); if (!refEntry.hasOnlyOneReference()) { return -1; } if (!refEntry.isTreeObj()) { return -1; } return refEntry.getRetainedSize(); } return 0; } }
Instance getNearestGCRootPointer(Instance instance) { if (heap.getGCRoot(instance) != null) { return instance; } computeGCRoots(); long nextGCPathId = heap.idToOffsetMap.get(instance.getInstanceId()).getNearestGCRootPointer(); return heap.getInstanceByID(nextGCPathId); }
private boolean processInstance(Instance instance, long size, long retainedSize) throws IOException { if (size != -1) { LongMap.Entry entry = heap.idToOffsetMap.get(instance.getInstanceId()); entry.setRetainedSize((int)(instance.getSize()+retainedSize)); entry.setTreeObj(); if (entry.hasOnlyOneReference()) { long gcRootPointer = entry.getNearestGCRootPointer(); if (gcRootPointer != 0) { if (!unique.contains(gcRootPointer)) { unique.add(gcRootPointer); writeLong(gcRootPointer); } } } return true; } return false; }
private boolean writeConnection(long instanceId, long refInstanceId, boolean addRefInstanceId) throws IOException { if (refInstanceId != 0) { LongMap.Entry entry = heap.idToOffsetMap.get(refInstanceId); if (entry != null && entry.getNearestGCRootPointer() == 0L && heap.getGCRoot(refInstanceId) == null) { writeLong(refInstanceId); if (addRefInstanceId) { if (!checkReferences(refInstanceId, instanceId)) { entry.addReference(instanceId); } } entry.setNearestGCRootPointer(instanceId); if (!entry.hasOnlyOneReference()) { multipleParents.writeLong(refInstanceId); //multiParentsCount++; } return true; } return !addRefInstanceId && entry != null; } return false; }
int idSize = dumpBuffer.getIDSize(); int classIdOffset = 0; LongMap.Entry entry = idToOffsetMap.get(instanceID);
private Long getNearestGCRootPointer(Long instanceIdLong) { LongMap.Entry entry; Long nearestGCLong = (Long) nearestGCRootCache.get(instanceIdLong); Long nearestGC; if (nearestGCLong != null) { return nearestGCLong; } entry = heap.idToOffsetMap.get(instanceIdLong.longValue()); nearestGC = Long.valueOf(entry.getNearestGCRootPointer()); nearestGCRootCache.put(instanceIdLong,nearestGC); return nearestGC; }
long getIdomId(long instanceId, LongMap.Entry entry) { Long idomEntry = (Long) map.get(new Long(instanceId)); if (idomEntry != null) { return idomEntry.longValue(); } if (entry == null) { entry = heap.idToOffsetMap.get(instanceId); } return entry.getNearestGCRootPointer(); }
long getIdomId(long instanceId, LongMap.Entry entry) { Long idomEntry = (Long) map.get(new Long(instanceId)); if (idomEntry != null) { return idomEntry.longValue(); } if (entry == null) { entry = heap.idToOffsetMap.get(instanceId); } return entry.getNearestGCRootPointer(); }
Instance getNearestGCRootPointer(Instance instance) { if (heap.getGCRoot(instance) != null) { return instance; } computeGCRoots(); long nextGCPathId = heap.idToOffsetMap.get(instance.getInstanceId()).getNearestGCRootPointer(); return heap.getInstanceByID(nextGCPathId); }
Instance getNearestGCRootPointer(Instance instance) { if (heap.getGCRoot(instance) != null) { return instance; } computeGCRoots(); long nextGCPathId = heap.idToOffsetMap.get(instance.getInstanceId()).getNearestGCRootPointer(); return heap.getInstanceByID(nextGCPathId); }