comparison src/share/vm/gc_implementation/parNew/parNewGeneration.cpp @ 263:12eea04c8b06

6672698: mangle_unused_area() should not remangle the entire heap at each collection. Summary: Maintain a high water mark for the allocations in a space and mangle only up to that high water mark. Reviewed-by: ysr, apetrusenko
author jmasa
date Wed, 09 Jul 2008 15:08:55 -0700
parents feeb96a45707
children 850fdf70db2b
comparison
equal deleted inserted replaced
225:286bee59f34b 263:12eea04c8b06
725 size_t gch_prev_used = gch->used(); 725 size_t gch_prev_used = gch->used();
726 726
727 SpecializationStats::clear(); 727 SpecializationStats::clear();
728 728
729 age_table()->clear(); 729 age_table()->clear();
730 to()->clear(); 730 to()->clear(SpaceDecorator::Mangle);
731 731
732 gch->save_marks(); 732 gch->save_marks();
733 assert(workers != NULL, "Need parallel worker threads."); 733 assert(workers != NULL, "Need parallel worker threads.");
734 ParallelTaskTerminator _term(workers->total_workers(), task_queues()); 734 ParallelTaskTerminator _term(workers->total_workers(), task_queues());
735 ParScanThreadStateSet thread_state_set(workers->total_workers(), 735 ParScanThreadStateSet thread_state_set(workers->total_workers(),
791 soft_ref_policy, &is_alive, &keep_alive, &evacuate_followers, 791 soft_ref_policy, &is_alive, &keep_alive, &evacuate_followers,
792 NULL); 792 NULL);
793 } 793 }
794 if (!promotion_failed()) { 794 if (!promotion_failed()) {
795 // Swap the survivor spaces. 795 // Swap the survivor spaces.
796 eden()->clear(); 796 eden()->clear(SpaceDecorator::Mangle);
797 from()->clear(); 797 from()->clear(SpaceDecorator::Mangle);
798 if (ZapUnusedHeapArea) {
799 // This is now done here because of the piece-meal mangling which
800 // can check for valid mangling at intermediate points in the
801 // collection(s). When a minor collection fails to collect
802 // sufficient space resizing of the young generation can occur
803 // an redistribute the spaces in the young generation. Mangle
804 // here so that unzapped regions don't get distributed to
805 // other spaces.
806 to()->mangle_unused_area();
807 }
798 swap_spaces(); 808 swap_spaces();
799 809
800 assert(to()->is_empty(), "to space should be empty now"); 810 assert(to()->is_empty(), "to space should be empty now");
801 } else { 811 } else {
802 assert(HandlePromotionFailure, 812 assert(HandlePromotionFailure,