示例#1
0
文件: Gen.java 项目: dtzWill/vmkit
  /**
   * This method controls the triggering of a GC. It is called periodically during allocation.
   * Returns true to trigger a collection.
   *
   * @param spaceFull Space request failed, must recover pages within 'space'.
   * @return True if a collection is requested by the plan.
   */
  public final boolean collectionRequired(boolean spaceFull) {
    int nurseryPages = nurserySpace.reservedPages();

    if (nurseryPages > Options.nurserySize.getMaxNursery()) {
      return true;
    }

    if (virtualMemoryExhausted()) return true;

    return super.collectionRequired(spaceFull);
  }
  /**
   * This method controls the triggering of a GC. It is called periodically during allocation.
   * Returns true to trigger a collection.
   *
   * @param spaceFull Space request failed, must recover pages within 'space'.
   * @return True if a collection is requested by the plan.
   */
  public final boolean collectionRequired(boolean spaceFull, Space space) {
    int nurseryPages = nurserySpace.reservedPages();

    if (nurseryPages > Options.nurserySize.getMaxNursery()) {
      return true;
    }

    if (virtualMemoryExhausted()) {
      return true;
    }

    if (spaceFull && space != nurserySpace) {
      nextGCFullHeap = true;
    }

    return super.collectionRequired(spaceFull, space);
  }
示例#3
0
文件: Gen.java 项目: dtzWill/vmkit
 /**
  * Return the number of pages reserved for copying.
  *
  * @return The number of pages reserved given the pending allocation, including space reserved for
  *     copying.
  */
 @Override
 public int getCollectionReserve() {
   return nurserySpace.reservedPages() + super.getCollectionReserve();
 }
示例#4
0
文件: Gen.java 项目: dtzWill/vmkit
 /**
  * Return the number of pages in use given the pending allocation. Simply add the nursery's
  * contribution to that of the superclass.
  *
  * @return The number of pages reserved given the pending allocation, excluding space reserved for
  *     copying.
  */
 @Override
 public int getPagesUsed() {
   return (nurserySpace.reservedPages() + super.getPagesUsed());
 }
示例#5
0
文件: Gen.java 项目: dtzWill/vmkit
 /**
  * Independent of how many pages remain in the page budget (a function of heap size), we must
  * ensure we never exhaust virtual memory. Therefore we must never let the nursery grow to the
  * extent that it can't be copied into the mature space.
  *
  * @return True if the nursery has grown to the extent that it may not be able to be copied into
  *     the mature space.
  */
 private boolean virtualMemoryExhausted() {
   return ((int) (nurserySpace.reservedPages() * WORST_CASE_COPY_EXPANSION)
       >= getMaturePhysicalPagesAvail());
 }
示例#6
0
文件: GenRC.java 项目: ut-osa/laminar
  /**
   * This method controls the triggering of a GC. It is called periodically during allocation.
   * Returns true to trigger a collection.
   *
   * @param spaceFull Space request failed, must recover pages within 'space'.
   * @return True if a collection is requested by the plan.
   */
  public final boolean collectionRequired(boolean spaceFull) {
    boolean nurseryFull = nurserySpace.reservedPages() > Options.nurserySize.getMaxNursery();

    return super.collectionRequired(spaceFull) || nurseryFull;
  }
示例#7
0
文件: GenRC.java 项目: ut-osa/laminar
 /**
  * Return the number of pages in use given the pending allocation. Simply add the nursery's
  * contribution to that of the superclass.
  *
  * @return The number of pages reserved given the pending allocation, excluding space reserved for
  *     copying.
  */
 public final int getPagesUsed() {
   return super.getPagesUsed() + nurserySpace.reservedPages();
 }
示例#8
0
文件: GenRC.java 项目: ut-osa/laminar
 /**
  * Return the number of pages reserved for copying.
  *
  * @return The number of pages reserved given the pending allocation, including space reserved for
  *     copying.
  */
 public final int getCollectionReserve() {
   return nurserySpace.reservedPages() + super.getCollectionReserve();
 }