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 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; }
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++; } } } }
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; } }
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; } }
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++; } } } }
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; } }