src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp

src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp

Print this page

        

*** 29,43 **** // There is a nice batch of tested generation sizing code in // TwoGenerationCollectorPolicy. Lets reuse it! class GenerationSizer : public TwoGenerationCollectorPolicy { ! public: ! GenerationSizer() { ! // Partial init only! ! initialize_flags(); ! initialize_size_info(); } void initialize_flags() { // Do basic sizing work TwoGenerationCollectorPolicy::initialize_flags(); --- 29,55 ---- // There is a nice batch of tested generation sizing code in // TwoGenerationCollectorPolicy. Lets reuse it! class GenerationSizer : public TwoGenerationCollectorPolicy { ! private: ! ! void trace_gen_sizes(const char* const str) { ! if (TracePageSizes) { ! tty->print_cr("%s: " SIZE_FORMAT "," SIZE_FORMAT " " ! SIZE_FORMAT "," SIZE_FORMAT " " ! SIZE_FORMAT, ! str, ! _min_gen1_size / K, _max_gen1_size / K, ! _min_gen0_size / K, _max_gen0_size / K, ! _max_heap_byte_size / K); ! } ! } ! ! void initialize_alignments() { ! _space_alignment = _gen_alignment = default_gen_alignment(); ! _heap_alignment = compute_heap_alignment(); } void initialize_flags() { // Do basic sizing work TwoGenerationCollectorPolicy::initialize_flags();
*** 49,71 **** // The survivor ratio's are calculated "raw", unlike the // default gc, which adds 2 to the ratio value. We need to // make sure the values are valid before using them. if (MinSurvivorRatio < 3) { ! MinSurvivorRatio = 3; } if (InitialSurvivorRatio < 3) { ! InitialSurvivorRatio = 3; } } ! size_t min_young_gen_size() { return _min_gen0_size; } ! size_t young_gen_size() { return _initial_gen0_size; } ! size_t max_young_gen_size() { return _max_gen0_size; } ! size_t min_old_gen_size() { return _min_gen1_size; } ! size_t old_gen_size() { return _initial_gen1_size; } ! size_t max_old_gen_size() { return _max_gen1_size; } }; #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GENERATIONSIZER_HPP --- 61,94 ---- // The survivor ratio's are calculated "raw", unlike the // default gc, which adds 2 to the ratio value. We need to // make sure the values are valid before using them. if (MinSurvivorRatio < 3) { ! FLAG_SET_ERGO(uintx, MinSurvivorRatio, 3); } if (InitialSurvivorRatio < 3) { ! FLAG_SET_ERGO(uintx, InitialSurvivorRatio, 3); } } ! void initialize_size_info() { ! trace_gen_sizes("ps heap raw"); ! const size_t page_sz = os::page_size_for_region(_min_heap_byte_size, ! _max_heap_byte_size, ! 8); ! ! // Can a page size be something else than a power of two? ! assert(is_power_of_2((intptr_t)page_sz), "must be a power of 2"); ! size_t new_alignment = round_to(page_sz, _gen_alignment); ! if (new_alignment != _gen_alignment) { ! _gen_alignment = new_alignment; ! // Redo everything from the start ! initialize_flags(); ! } ! TwoGenerationCollectorPolicy::initialize_size_info(); ! trace_gen_sizes("ps heap rnd"); ! } }; #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GENERATIONSIZER_HPP
src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File