]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added some instrumentation.
authorPeter Bernard West <pbwest@apache.org>
Wed, 27 Nov 2002 03:04:02 +0000 (03:04 +0000)
committerPeter Bernard West <pbwest@apache.org>
Wed, 27 Nov 2002 03:04:02 +0000 (03:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@195634 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/apps/Fop.java

index ba103396917724ed55788c19ed68e133fa17db5f..622255cb1e48ac4075b9329b0544037c8233c599 100644 (file)
@@ -10,16 +10,47 @@ package org.apache.fop.apps;
 import org.apache.fop.messaging.MessageHandler;
 
 public class Fop {
+
+    public static Runtime runtime;
+    public static long startTotal;
+    public static long startFree;
+    public static long startTime;
+    public static long startPCi;
+    public static long endPCi;
+
     public static void main(String[] args) {
 
+       long endtotal, endfree, gctotal, gcfree;
         Driver driver;
         Boolean bool = null;
 
+       runtime = Runtime.getRuntime();
+       startTotal = runtime.totalMemory();
+       startFree = runtime.freeMemory();
+       startTime = System.currentTimeMillis();
+
         try {
             Options.configure(args);
             driver = new Driver();
             driver.run();
             System.out.println("Back from driver.run()");
+           System.out.println("Elapsed time: " +
+                               (System.currentTimeMillis() - startTime));
+           endtotal = runtime.totalMemory();
+           System.out.println("Total memory: " + endtotal);
+           System.out.println("Total diff  : " + (endtotal - startTotal));
+           endfree = runtime.freeMemory();
+           System.out.println("Free  memory: " + endfree);
+           System.out.println("Free  diff  : " + (endfree - startFree ));
+           System.gc();
+           gctotal = runtime.totalMemory();
+           System.out.println("Total memory: " + gctotal);
+           System.out.println("Total diff  : " + (gctotal - startTotal));
+           gcfree = runtime.freeMemory();
+           System.out.println("Free  memory: " + gcfree);
+           System.out.println("Free  diff  : " + (gcfree - startFree ));
+           System.out.println("cg() freed  : " + (gcfree - endfree));
+           System.out.println("PC time     : " + (endPCi - startPCi));
             
         } catch (FOPException e) {
             MessageHandler.errorln("ERROR: " + e.getMessage());