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(); }
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; }
long instSize = 0; if (!isTreeObj && (instanceEntry.getNearestGCRootPointer() != 0 || getGCRoot(new Long(instanceId)) != null)) { long origSize = instanceEntry.getRetainedSize(); if (origSize < 0) origSize = 0;
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; }
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; }
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 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 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 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 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); }
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; }
Instance getNearestGCRootPointer(Instance instance) { if (heap.getGCRoot(instance) != null) { return instance; } computeGCRoots(); long nextGCPathId = heap.idToOffsetMap.get(instance.getInstanceId()).getNearestGCRootPointer(); return heap.getInstanceByID(nextGCPathId); }
long instSize = 0; if (!isTreeObj && (instanceEntry.getNearestGCRootPointer() != 0 || getGCRoot(new Long(instanceId)) != null)) { long origSize = instanceEntry.getRetainedSize(); if (origSize < 0) origSize = 0;
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; }
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++; } } } }
Instance getNearestGCRootPointer(Instance instance) { if (heap.getGCRoot(instance) != null) { return instance; } computeGCRoots(); long nextGCPathId = heap.idToOffsetMap.get(instance.getInstanceId()).getNearestGCRootPointer(); return heap.getInstanceByID(nextGCPathId); }