46 // minimum size for young gen. Still using G1MaxNewSizePercent of the
47 // heap as maximum.
48 //
49 // If only -XX:MaxNewSize is set we should use the specified value as the
50 // maximum size for young gen. Still using G1NewSizePercent of the heap
51 // as minimum.
52 //
53 // If -XX:NewSize and -XX:MaxNewSize are both specified we use these values.
54 // No updates when the heap size changes. There is a special case when
55 // NewSize==MaxNewSize. This is interpreted as "fixed" and will use a
56 // different heuristic for calculating the collection set when we do mixed
57 // collection.
58 //
59 // If only -XX:NewRatio is set we should use the specified ratio of the heap
60 // as both min and max. This will be interpreted as "fixed" just like the
61 // NewSize==MaxNewSize case above. But we will update the min and max
62 // every time the heap size changes.
63 //
64 // NewSize and MaxNewSize override NewRatio. So, NewRatio is ignored if it is
65 // combined with either NewSize or MaxNewSize. (A warning message is printed.)
66 class G1YoungGenSizer VALUE_OBJ_CLASS_SPEC {
67 private:
68 enum SizerKind {
69 SizerDefaults,
70 SizerNewSizeOnly,
71 SizerMaxNewSizeOnly,
72 SizerMaxAndNewSize,
73 SizerNewRatio
74 };
75 SizerKind _sizer_kind;
76 uint _min_desired_young_length;
77 uint _max_desired_young_length;
78
79 // False when using a fixed young generation size due to command-line options,
80 // true otherwise.
81 bool _adaptive_size;
82
83 uint calculate_default_min_length(uint new_number_of_heap_regions);
84 uint calculate_default_max_length(uint new_number_of_heap_regions);
85
86 // Update the given values for minimum and maximum young gen length in regions
|
46 // minimum size for young gen. Still using G1MaxNewSizePercent of the
47 // heap as maximum.
48 //
49 // If only -XX:MaxNewSize is set we should use the specified value as the
50 // maximum size for young gen. Still using G1NewSizePercent of the heap
51 // as minimum.
52 //
53 // If -XX:NewSize and -XX:MaxNewSize are both specified we use these values.
54 // No updates when the heap size changes. There is a special case when
55 // NewSize==MaxNewSize. This is interpreted as "fixed" and will use a
56 // different heuristic for calculating the collection set when we do mixed
57 // collection.
58 //
59 // If only -XX:NewRatio is set we should use the specified ratio of the heap
60 // as both min and max. This will be interpreted as "fixed" just like the
61 // NewSize==MaxNewSize case above. But we will update the min and max
62 // every time the heap size changes.
63 //
64 // NewSize and MaxNewSize override NewRatio. So, NewRatio is ignored if it is
65 // combined with either NewSize or MaxNewSize. (A warning message is printed.)
66 class G1YoungGenSizer {
67 private:
68 enum SizerKind {
69 SizerDefaults,
70 SizerNewSizeOnly,
71 SizerMaxNewSizeOnly,
72 SizerMaxAndNewSize,
73 SizerNewRatio
74 };
75 SizerKind _sizer_kind;
76 uint _min_desired_young_length;
77 uint _max_desired_young_length;
78
79 // False when using a fixed young generation size due to command-line options,
80 // true otherwise.
81 bool _adaptive_size;
82
83 uint calculate_default_min_length(uint new_number_of_heap_regions);
84 uint calculate_default_max_length(uint new_number_of_heap_regions);
85
86 // Update the given values for minimum and maximum young gen length in regions
|