use of com.ibm.dtfj.image.j9.ImageSection in project openj9 by eclipse.
the class JavaObject method getSize.
/* (non-Javadoc)
* @see com.ibm.dtfj.java.JavaObject#getSize()
*/
public long getSize() throws CorruptDataException {
// this is the total number of bytes consumed by the object so we will total up the section sizes
Iterator sections = getSections();
long size = 0;
// Originally came from Dump analyzer defect 74504.
while (sections.hasNext()) {
Object qsect = sections.next();
if (qsect instanceof ImageSection) {
ImageSection section = (ImageSection) qsect;
size += section.getSize();
} else {
if (qsect instanceof CorruptData) {
throw new CorruptDataException((CorruptData) qsect);
} else {
throw new RuntimeException("Found unexpected object " + qsect.getClass().getName());
}
}
}
return size;
}
Aggregations