use of com.ibm.dtfj.javacore.builder.IJavaRuntimeBuilder in project openj9 by eclipse.
the class NativeMemorySectionParser method topLevelRule.
protected void topLevelRule() throws ParserException {
IImageProcessBuilder fImageProcessBuilder = fImageBuilder.getCurrentAddressSpaceBuilder().getCurrentImageProcessBuilder();
IJavaRuntimeBuilder fRuntimeBuilder = fImageProcessBuilder.getCurrentJavaRuntimeBuilder();
IAttributeValueMap results = null;
Stack categoryStack = new Stack();
processTagLineOptional(T_0MEMUSER);
while ((results = processMemUserLine()) != null) {
String name = results.getTokenValue(A_NAME);
/* If no name available, this is a spacing line */
if (name == null) {
continue;
}
int depth = results.getIntValue(A_DEPTH);
while (categoryStack.size() >= depth) {
categoryStack.pop();
}
long deepBytes = parseCommaDelimitedLong(results.getTokenValue(A_DEEP_BYTES));
long deepAllocations = parseCommaDelimitedLong(results.getTokenValue(A_DEEP_ALLOCATIONS));
JavaRuntimeMemoryCategory parent = null;
if (categoryStack.size() > 0) {
parent = (JavaRuntimeMemoryCategory) categoryStack.peek();
}
if (name.equals(OTHER_CATEGORY)) {
if (parent == null) {
throw new ParserException("Parse error: Unexpected NULL parent category for \"Other\" memory category");
}
fRuntimeBuilder.setShallowCountersForCategory(parent, deepBytes, deepAllocations);
} else {
JavaRuntimeMemoryCategory category = fRuntimeBuilder.addMemoryCategory(name, deepBytes, deepAllocations, parent);
categoryStack.push(category);
}
}
}
Aggregations