コード例 #1
0
ファイル: Gen.java プロジェクト: dtzWill/vmkit
  /**
   * Determine if this GC should be a full heap collection.
   *
   * @return True is this GC should be a full heap collection.
   */
  protected boolean requiresFullHeapCollection() {
    if (collectionTrigger == Collection.EXTERNAL_GC_TRIGGER
        && Options.fullHeapSystemGC.getValue()) {
      return true;
    }

    if (nextGCFullHeap || collectionAttempt > 1) {
      // Forces full heap collection
      return true;
    }

    if (loSpace.allocationFailed()
        || nonMovingSpace.allocationFailed()
        || (USE_CODE_SPACE
            && (largeCodeSpace.allocationFailed() || smallCodeSpace.allocationFailed()))) {
      // We need space from the nursery
      return true;
    }

    if (virtualMemoryExhausted()) return true;

    int smallNurseryPages = nurserySpace.committedPages();
    int smallNurseryYield = (int) ((smallNurseryPages << 1) * SURVIVAL_ESTIMATE);

    if (smallNurseryYield < getPagesRequired()) {
      // Our total yield is insufficent.
      return true;
    }

    if (nurserySpace.allocationFailed()) {
      if (smallNurseryYield < (nurserySpace.requiredPages() << 1)) {
        // We have run out of VM pages in the nursery
        return true;
      }
    }

    return false;
  }
コード例 #2
0
ファイル: Gen.java プロジェクト: dtzWill/vmkit
 /**
  * Calculate the number of pages a collection is required to free to satisfy outstanding
  * allocation requests.
  *
  * @return the number of pages a collection is required to free to satisfy outstanding allocation
  *     requests.
  */
 @Override
 public int getPagesRequired() {
   /* We don't currently pretenure, so mature space must be zero */
   return super.getPagesRequired() + (nurserySpace.requiredPages() << 1);
 }
コード例 #3
0
ファイル: GenRC.java プロジェクト: ut-osa/laminar
 /**
  * Calculate the number of pages a collection is required to free to satisfy outstanding
  * allocation requests.
  *
  * @return the number of pages a collection is required to free to satisfy outstanding allocation
  *     requests.
  */
 public int getPagesRequired() {
   return super.getPagesRequired() + (nurserySpace.requiredPages() << 1);
 }