23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GENERATIONSIZER_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GENERATIONSIZER_HPP
27
28 #include "memory/collectorPolicy.hpp"
29
30 // There is a nice batch of tested generation sizing code in
31 // TwoGenerationCollectorPolicy. Lets reuse it!
32
33 class GenerationSizer : public TwoGenerationCollectorPolicy {
34 public:
35 GenerationSizer() {
36 // Partial init only!
37 initialize_flags();
38 initialize_size_info();
39 }
40
41 void initialize_flags() {
42 // Do basic sizing work
43 this->TwoGenerationCollectorPolicy::initialize_flags();
44
45 // If the user hasn't explicitly set the number of worker
46 // threads, set the count.
47 assert(UseSerialGC ||
48 !FLAG_IS_DEFAULT(ParallelGCThreads) ||
49 (ParallelGCThreads > 0),
50 "ParallelGCThreads should be set before flag initialization");
51
52 // The survivor ratio's are calculated "raw", unlike the
53 // default gc, which adds 2 to the ratio value. We need to
54 // make sure the values are valid before using them.
55 if (MinSurvivorRatio < 3) {
56 MinSurvivorRatio = 3;
57 }
58
59 if (InitialSurvivorRatio < 3) {
60 InitialSurvivorRatio = 3;
61 }
62 }
63
|
23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GENERATIONSIZER_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_GENERATIONSIZER_HPP
27
28 #include "memory/collectorPolicy.hpp"
29
30 // There is a nice batch of tested generation sizing code in
31 // TwoGenerationCollectorPolicy. Lets reuse it!
32
33 class GenerationSizer : public TwoGenerationCollectorPolicy {
34 public:
35 GenerationSizer() {
36 // Partial init only!
37 initialize_flags();
38 initialize_size_info();
39 }
40
41 void initialize_flags() {
42 // Do basic sizing work
43 TwoGenerationCollectorPolicy::initialize_flags();
44
45 // If the user hasn't explicitly set the number of worker
46 // threads, set the count.
47 assert(UseSerialGC ||
48 !FLAG_IS_DEFAULT(ParallelGCThreads) ||
49 (ParallelGCThreads > 0),
50 "ParallelGCThreads should be set before flag initialization");
51
52 // The survivor ratio's are calculated "raw", unlike the
53 // default gc, which adds 2 to the ratio value. We need to
54 // make sure the values are valid before using them.
55 if (MinSurvivorRatio < 3) {
56 MinSurvivorRatio = 3;
57 }
58
59 if (InitialSurvivorRatio < 3) {
60 InitialSurvivorRatio = 3;
61 }
62 }
63
|