// because parseFile() works best on relative pathnames and
// has problems finding resources like files specified in
// parameters if the xml file was specified as an absolute path.
//CompositeActor toplevel = (CompositeActor) parser.parse(null,
// new File(xmlFilename).toURL());
Manager manager = new Manager(_toplevel.workspace(),
"MoMLSimpleStatisticalApplication");
_toplevel.setManager(manager);
_toplevel.addChangeListener(this);
Runtime runtime = Runtime.getRuntime();
// Get the memory stats before we get the model name
// just to be sure that getting the model name does
// not skew are data too much
long totalMemory1 = runtime.totalMemory() / 1024;
long freeMemory1 = runtime.freeMemory() / 1024;
String modelName = _toplevel.getName();
System.out.println(modelName + ": Stats before execution: "
+ Manager.timeAndMemory(startTime, totalMemory1, freeMemory1));
// Second, we run and print memory stats.
manager.execute();
long totalMemory2 = runtime.totalMemory() / 1024;
long freeMemory2 = runtime.freeMemory() / 1024;
String standardStats = Manager.timeAndMemory(startTime, totalMemory2,
freeMemory2);