src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp	Thu Oct 31 16:44:05 2013
--- new/src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp	Thu Oct 31 16:44:05 2013

*** 29,99 **** --- 29,47 ---- // 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 trace_gen_sizes(const char* const str); // The alignment used for boundary between young gen and old gen ! static size_t default_gen_alignment() { return 64 * K * HeapWordSize; } return 64 * K * HeapWordSize; } void initialize_flags() { // Do basic sizing work TwoGenerationCollectorPolicy::initialize_flags(); assert(UseSerialGC || !FLAG_IS_DEFAULT(ParallelGCThreads) || (ParallelGCThreads > 0), "ParallelGCThreads should be set before flag initialization"); // 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"); } }; + protected: + void initialize_alignments(); + void initialize_flags(); + void initialize_size_info(); + }; #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