- *
com.smp.common.coremodel.*,
com.smp.common.performance.*,
com.mcdata.mpii.*
Except for the coremodel package, the statistics for the other packages check out correctly with the numbers in the profiler UI. The object count, the shallow size, and the retained size from API for the coremodel package consistently do not match with the numbers in the profiler UI.
I checked my code and the profiler UI carefully many times. I can not find a mistake in my code. What else can I check or do to make progress?
I am enclosing the analysis code in case you are in a magnanimous mood today. I am looking for some possible causes that I have not considered yet and some troubleshooting tips.
Thanks
Jagadeesh
Code: Select all
public void analysis()
{
final String all = "<objects class=\"*\"/>";
final String coremodel = "<objects class=\"com.smp.common.coremodel.*\"/>";
final String coremodelretained = "<retained-objects>" + coremodel + "</retained-objects>";
final String performance = "<objects class=\"com.smp.common.performance.*\"/>";
final String performanceretained = "<retained-objects>" + performance + "</retained-objects>";
final String mpii = "<objects class=\"com.mcdata.mpii.*\"/>";
final String mpiiretained = "<retained-objects>" + mpii + "</retained-objects>";
System.out.println("Total Count, Total Shallow, CM count, CM Shallow, CM Retained, Perf count, Perf Shallow, Perf Retained, mpii count, mpii Shallow, mpii Retained, file name");
for(int i=0; max == -1 || i<max; i++) {
String snapshotFileName = snapshotName(i)+".memory";
File snapshotFile = new File(snapshotFileName);
if (!snapshotFile.exists()) {
// end of snapshots..
System.out.println("File "+snapshotFileName+" does not exist");
break;
}
try {
// Load snapshot for analysis
final MemorySnapshot snapshot = new MemorySnapshot(snapshotFile, null, null);
// Get and print some statistics
System.out.print(""+i+",");
System.out.print("" + snapshot.getObjectCount(all));
System.out.print(",");
System.out.print("" + snapshot.getShallowSize(all));
System.out.print(",");
System.out.print("" + snapshot.getObjectCount(coremodel));
System.out.print(",");
System.out.print("" + snapshot.getShallowSize(coremodel));
System.out.print(",");
System.out.print("" + snapshot.getShallowSize(coremodelretained));
System.out.print(",");
System.out.print("" + snapshot.getObjectCount(performance));
System.out.print(",");
System.out.print("" + snapshot.getShallowSize(performance));
System.out.print(",");
System.out.print("" + snapshot.getShallowSize(performanceretained));
System.out.print(",");
System.out.print("" + snapshot.getObjectCount(mpii));
System.out.print(",");
System.out.print("" + snapshot.getShallowSize(mpii));
System.out.print(",");
System.out.print("" + snapshot.getShallowSize(mpiiretained));
System.out.print(",");
System.out.print(snapshotFileName);
System.out.println();
}
catch (Exception ex) {
System.out.println("Cannot load captured snapshot. Reason: " + ex.getMessage());
ex.printStackTrace();
}
}
}