Exemplo n.º 1
0
 /** Print out statistics at the end of a GC */
 public final void printPostStats() {
   if ((Options.verbose.getValue() == 1) || (Options.verbose.getValue() == 2)) {
     Log.write("-> ");
     Log.writeDec(Conversions.pagesToBytes(getPagesUsed()).toWord().rshl(10));
     Log.write("KB   ");
     if (Options.verbose.getValue() == 1) {
       totalTime.printLast();
       Log.writeln(" ms]");
     } else {
       Log.write("End ");
       totalTime.printTotal();
       Log.writeln(" ms]");
     }
   }
   if (Options.verbose.getValue() > 2) {
     Log.write("   After Collection: ");
     Space.printUsageMB();
     if (Options.verbose.getValue() >= 4) {
       Log.write("                     ");
       Space.printUsagePages();
     }
     if (Options.verbose.getValue() >= 5) {
       Space.printVMMap();
     }
     Log.write("                     ");
     printUsedPages();
     Log.write("    Collection time: ");
     totalTime.printLast();
     Log.writeln(" ms");
   }
 }
Exemplo n.º 2
0
 /**
  * The VM is about to exit. Perform any clean up operations.
  *
  * @param value The exit value
  */
 @Interruptible
 public void notifyExit(int value) {
   if (Options.harnessAll.getValue()) harnessEnd();
   if (Options.verbose.getValue() == 1) {
     Log.write("[End ");
     totalTime.printTotalSecs();
     Log.writeln(" s]");
   } else if (Options.verbose.getValue() == 2) {
     Log.write("[End ");
     totalTime.printTotalMillis();
     Log.writeln(" ms]");
   }
   if (Options.verboseTiming.getValue()) printDetailedTiming(true);
 }
  /**
   * Perform a (global) collection phase.
   *
   * @param phaseId Collection phase to execute.
   */
  @NoInline
  public void collectionPhase(short phaseId) {
    if (phaseId == SET_COLLECTION_KIND) {
      super.collectionPhase(phaseId);
      gcFullHeap = requiresFullHeapCollection();
      return;
    }

    if (phaseId == PREPARE) {
      nurserySpace.prepare(true);
      if (traceFullHeap()) {
        if (gcFullHeap) {
          if (Stats.gatheringStats()) fullHeap.set();
          fullHeapTime.start();
        }
        super.collectionPhase(phaseId);

        // we can throw away the remsets (but not modbuf) for a full heap GC
        remsetPool.clearDeque(1);
        arrayRemsetPool.clearDeque(2);
      }
      return;
    }

    if (phaseId == CLOSURE) {
      if (!traceFullHeap()) {
        nurseryTrace.prepare();
      }
      return;
    }

    if (phaseId == RELEASE) {
      nurserySpace.release();
      modbufPool.clearDeque(1);
      remsetPool.clearDeque(1);
      arrayRemsetPool.clearDeque(2);
      if (!traceFullHeap()) {
        nurseryTrace.release();
      } else {
        super.collectionPhase(phaseId);
        if (gcFullHeap) fullHeapTime.stop();
      }
      nextGCFullHeap = (getPagesAvail() < Options.nurserySize.getMinNursery());
      return;
    }

    super.collectionPhase(phaseId);
  }