314 // Let the size policy know we're starting
315 size_policy->minor_collection_begin();
316
317 // Verify the object start arrays.
318 if (VerifyObjectStartArray &&
319 VerifyBeforeGC) {
320 old_gen->verify_object_start_array();
321 }
322
323 // Verify no unmarked old->young roots
324 if (VerifyRememberedSets) {
325 CardTableExtension::verify_all_young_refs_imprecise();
326 }
327
328 assert(young_gen->to_space()->is_empty(),
329 "Attempt to scavenge with live objects in to_space");
330 young_gen->to_space()->clear(SpaceDecorator::Mangle);
331
332 save_to_space_top_before_gc();
333
334 #if defined(COMPILER2) || INCLUDE_JVMCI
335 DerivedPointerTable::clear();
336 #endif
337
338 reference_processor()->enable_discovery();
339 reference_processor()->setup_policy(false);
340
341 PreGCValues pre_gc_values(heap);
342
343 // Reset our survivor overflow.
344 set_survivor_overflow(false);
345
346 // We need to save the old top values before
347 // creating the promotion_manager. We pass the top
348 // values to the card_table, to prevent it from
349 // straying into the promotion labs.
350 HeapWord* old_top = old_gen->object_space()->top();
351
352 // Release all previously held resources
353 gc_task_manager()->release_all_resources();
354
584
585 heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(),
586 size_policy->calculated_survivor_size_in_bytes());
587
588 log_debug(gc, ergo)("AdaptiveSizeStop: collection: %d ", heap->total_collections());
589 }
590
591 // Update the structure of the eden. With NUMA-eden CPU hotplugging or offlining can
592 // cause the change of the heap layout. Make sure eden is reshaped if that's the case.
593 // Also update() will case adaptive NUMA chunk resizing.
594 assert(young_gen->eden_space()->is_empty(), "eden space should be empty now");
595 young_gen->eden_space()->update();
596
597 heap->gc_policy_counters()->update_counters();
598
599 heap->resize_all_tlabs();
600
601 assert(young_gen->to_space()->is_empty(), "to space should be empty now");
602 }
603
604 #if defined(COMPILER2) || INCLUDE_JVMCI
605 DerivedPointerTable::update_pointers();
606 #endif
607
608 NOT_PRODUCT(reference_processor()->verify_no_references_recorded());
609
610 // Re-verify object start arrays
611 if (VerifyObjectStartArray &&
612 VerifyAfterGC) {
613 old_gen->verify_object_start_array();
614 }
615
616 // Verify all old -> young cards are now precise
617 if (VerifyRememberedSets) {
618 // Precise verification will give false positives. Until this is fixed,
619 // use imprecise verification.
620 // CardTableExtension::verify_all_young_refs_precise();
621 CardTableExtension::verify_all_young_refs_imprecise();
622 }
623
624 if (log_is_enabled(Debug, gc, heap, exit)) {
|
314 // Let the size policy know we're starting
315 size_policy->minor_collection_begin();
316
317 // Verify the object start arrays.
318 if (VerifyObjectStartArray &&
319 VerifyBeforeGC) {
320 old_gen->verify_object_start_array();
321 }
322
323 // Verify no unmarked old->young roots
324 if (VerifyRememberedSets) {
325 CardTableExtension::verify_all_young_refs_imprecise();
326 }
327
328 assert(young_gen->to_space()->is_empty(),
329 "Attempt to scavenge with live objects in to_space");
330 young_gen->to_space()->clear(SpaceDecorator::Mangle);
331
332 save_to_space_top_before_gc();
333
334 #if COMPILER2_OR_JVMCI
335 DerivedPointerTable::clear();
336 #endif
337
338 reference_processor()->enable_discovery();
339 reference_processor()->setup_policy(false);
340
341 PreGCValues pre_gc_values(heap);
342
343 // Reset our survivor overflow.
344 set_survivor_overflow(false);
345
346 // We need to save the old top values before
347 // creating the promotion_manager. We pass the top
348 // values to the card_table, to prevent it from
349 // straying into the promotion labs.
350 HeapWord* old_top = old_gen->object_space()->top();
351
352 // Release all previously held resources
353 gc_task_manager()->release_all_resources();
354
584
585 heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(),
586 size_policy->calculated_survivor_size_in_bytes());
587
588 log_debug(gc, ergo)("AdaptiveSizeStop: collection: %d ", heap->total_collections());
589 }
590
591 // Update the structure of the eden. With NUMA-eden CPU hotplugging or offlining can
592 // cause the change of the heap layout. Make sure eden is reshaped if that's the case.
593 // Also update() will case adaptive NUMA chunk resizing.
594 assert(young_gen->eden_space()->is_empty(), "eden space should be empty now");
595 young_gen->eden_space()->update();
596
597 heap->gc_policy_counters()->update_counters();
598
599 heap->resize_all_tlabs();
600
601 assert(young_gen->to_space()->is_empty(), "to space should be empty now");
602 }
603
604 #if COMPILER2_OR_JVMCI
605 DerivedPointerTable::update_pointers();
606 #endif
607
608 NOT_PRODUCT(reference_processor()->verify_no_references_recorded());
609
610 // Re-verify object start arrays
611 if (VerifyObjectStartArray &&
612 VerifyAfterGC) {
613 old_gen->verify_object_start_array();
614 }
615
616 // Verify all old -> young cards are now precise
617 if (VerifyRememberedSets) {
618 // Precise verification will give false positives. Until this is fixed,
619 // use imprecise verification.
620 // CardTableExtension::verify_all_young_refs_precise();
621 CardTableExtension::verify_all_young_refs_imprecise();
622 }
623
624 if (log_is_enabled(Debug, gc, heap, exit)) {
|