/** * 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; }
/** * 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); }
/** * 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); }