src/share/vm/memory/collectorPolicy.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hs-gc-reduce Sdiff src/share/vm/memory

src/share/vm/memory/collectorPolicy.cpp

Print this page




 801   size_t gen0_capacity = gch->get_gen(0)->capacity_before_gc();
 802   return    (word_size > heap_word_size(gen0_capacity))
 803          || GC_locker::is_active_and_needs_gc()
 804          || gch->incremental_collection_failed();
 805 }
 806 
 807 
 808 //
 809 // MarkSweepPolicy methods
 810 //
 811 
 812 MarkSweepPolicy::MarkSweepPolicy() {
 813   initialize_all();
 814 }
 815 
 816 void MarkSweepPolicy::initialize_generations() {
 817   _generations = new GenerationSpecPtr[number_of_generations()];
 818   if (_generations == NULL)
 819     vm_exit_during_initialization("Unable to allocate gen spec");
 820 
 821   if (UseParNewGC && ParallelGCThreads > 0) {
 822     _generations[0] = new GenerationSpec(Generation::ParNew, _initial_gen0_size, _max_gen0_size);
 823   } else {
 824     _generations[0] = new GenerationSpec(Generation::DefNew, _initial_gen0_size, _max_gen0_size);
 825   }
 826   _generations[1] = new GenerationSpec(Generation::MarkSweepCompact, _initial_gen1_size, _max_gen1_size);
 827 
 828   if (_generations[0] == NULL || _generations[1] == NULL)
 829     vm_exit_during_initialization("Unable to allocate gen spec");
 830 }
 831 
 832 void MarkSweepPolicy::initialize_gc_policy_counters() {
 833   // initialize the policy counters - 2 collectors, 3 generations
 834   if (UseParNewGC && ParallelGCThreads > 0) {
 835     _gc_policy_counters = new GCPolicyCounters("ParNew:MSC", 2, 3);
 836   }
 837   else {
 838     _gc_policy_counters = new GCPolicyCounters("Copy:MSC", 2, 3);
 839   }
 840 }


 801   size_t gen0_capacity = gch->get_gen(0)->capacity_before_gc();
 802   return    (word_size > heap_word_size(gen0_capacity))
 803          || GC_locker::is_active_and_needs_gc()
 804          || gch->incremental_collection_failed();
 805 }
 806 
 807 
 808 //
 809 // MarkSweepPolicy methods
 810 //
 811 
 812 MarkSweepPolicy::MarkSweepPolicy() {
 813   initialize_all();
 814 }
 815 
 816 void MarkSweepPolicy::initialize_generations() {
 817   _generations = new GenerationSpecPtr[number_of_generations()];
 818   if (_generations == NULL)
 819     vm_exit_during_initialization("Unable to allocate gen spec");
 820 
 821   if (UseParNewGC) {
 822     _generations[0] = new GenerationSpec(Generation::ParNew, _initial_gen0_size, _max_gen0_size);
 823   } else {
 824     _generations[0] = new GenerationSpec(Generation::DefNew, _initial_gen0_size, _max_gen0_size);
 825   }
 826   _generations[1] = new GenerationSpec(Generation::MarkSweepCompact, _initial_gen1_size, _max_gen1_size);
 827 
 828   if (_generations[0] == NULL || _generations[1] == NULL)
 829     vm_exit_during_initialization("Unable to allocate gen spec");
 830 }
 831 
 832 void MarkSweepPolicy::initialize_gc_policy_counters() {
 833   // initialize the policy counters - 2 collectors, 3 generations
 834   if (UseParNewGC) {
 835     _gc_policy_counters = new GCPolicyCounters("ParNew:MSC", 2, 3);
 836   } else {

 837     _gc_policy_counters = new GCPolicyCounters("Copy:MSC", 2, 3);
 838   }
 839 }
src/share/vm/memory/collectorPolicy.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File