comparison src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp @ 6011:f7a8920427a6

7145441: G1: collection set chooser-related cleanup Summary: Cleanup of the CSet chooser class: standardize on uints for region num and indexes (instead of int, jint, etc.), make the method / field naming style more consistent, remove a lot of dead code. Reviewed-by: johnc, brutisso
author tonyp
date Wed, 18 Apr 2012 13:39:55 -0400
parents 720b6a76dd9d
children 3a22b77e755a
comparison
equal deleted inserted replaced
6010:720b6a76dd9d 6011:f7a8920427a6
286 TruncatedSeq* _pending_cards_seq; 286 TruncatedSeq* _pending_cards_seq;
287 TruncatedSeq* _rs_lengths_seq; 287 TruncatedSeq* _rs_lengths_seq;
288 288
289 TruncatedSeq* _cost_per_byte_ms_during_cm_seq; 289 TruncatedSeq* _cost_per_byte_ms_during_cm_seq;
290 290
291 TruncatedSeq* _young_gc_eff_seq;
292
293 G1YoungGenSizer* _young_gen_sizer; 291 G1YoungGenSizer* _young_gen_sizer;
294 292
295 uint _eden_cset_region_length; 293 uint _eden_cset_region_length;
296 uint _survivor_cset_region_length; 294 uint _survivor_cset_region_length;
297 uint _old_cset_region_length; 295 uint _old_cset_region_length;
312 double _recorded_non_young_free_cset_time_ms; 310 double _recorded_non_young_free_cset_time_ms;
313 311
314 double _sigma; 312 double _sigma;
315 313
316 size_t _rs_lengths_prediction; 314 size_t _rs_lengths_prediction;
317
318 size_t _known_garbage_bytes;
319 double _known_garbage_ratio;
320 315
321 double sigma() { return _sigma; } 316 double sigma() { return _sigma; }
322 317
323 // A function that prevents us putting too much stock in small sample 318 // A function that prevents us putting too much stock in small sample
324 // sets. Returns a number between 2.0 and 1.0, depending on the number 319 // sets. Returns a number between 2.0 and 1.0, depending on the number
507 502
508 void record_non_young_free_cset_time_ms(double time_ms) { 503 void record_non_young_free_cset_time_ms(double time_ms) {
509 _recorded_non_young_free_cset_time_ms = time_ms; 504 _recorded_non_young_free_cset_time_ms = time_ms;
510 } 505 }
511 506
512 double predict_young_gc_eff() {
513 return get_new_neg_prediction(_young_gc_eff_seq);
514 }
515
516 double predict_survivor_regions_evac_time(); 507 double predict_survivor_regions_evac_time();
517 508
518 void cset_regions_freed() { 509 void cset_regions_freed() {
519 bool propagate = _last_gc_was_young && !_in_marking_window; 510 bool propagate = _last_gc_was_young && !_in_marking_window;
520 _short_lived_surv_rate_group->all_surviving_words_recorded(propagate); 511 _short_lived_surv_rate_group->all_surviving_words_recorded(propagate);
521 _survivor_surv_rate_group->all_surviving_words_recorded(propagate); 512 _survivor_surv_rate_group->all_surviving_words_recorded(propagate);
522 // also call it on any more surv rate groups 513 // also call it on any more surv rate groups
523 }
524
525 void set_known_garbage_bytes(size_t known_garbage_bytes) {
526 _known_garbage_bytes = known_garbage_bytes;
527 size_t heap_bytes = _g1->capacity();
528 _known_garbage_ratio = (double) _known_garbage_bytes / (double) heap_bytes;
529 }
530
531 void decrease_known_garbage_bytes(size_t known_garbage_bytes) {
532 guarantee( _known_garbage_bytes >= known_garbage_bytes, "invariant" );
533
534 _known_garbage_bytes -= known_garbage_bytes;
535 size_t heap_bytes = _g1->capacity();
536 _known_garbage_ratio = (double) _known_garbage_bytes / (double) heap_bytes;
537 } 514 }
538 515
539 G1MMUTracker* mmu_tracker() { 516 G1MMUTracker* mmu_tracker() {
540 return _mmu_tracker; 517 return _mmu_tracker;
541 } 518 }
1024 1001
1025 // If an expansion would be appropriate, because recent GC overhead had 1002 // If an expansion would be appropriate, because recent GC overhead had
1026 // exceeded the desired limit, return an amount to expand by. 1003 // exceeded the desired limit, return an amount to expand by.
1027 size_t expansion_amount(); 1004 size_t expansion_amount();
1028 1005
1029 #ifndef PRODUCT
1030 // Check any appropriate marked bytes info, asserting false if
1031 // something's wrong, else returning "true".
1032 bool assertMarkedBytesDataOK();
1033 #endif
1034
1035 // Print tracing information. 1006 // Print tracing information.
1036 void print_tracing_info() const; 1007 void print_tracing_info() const;
1037 1008
1038 // Print stats on young survival ratio 1009 // Print stats on young survival ratio
1039 void print_yg_surv_rate_info() const; 1010 void print_yg_surv_rate_info() const;
1070 _gcs_are_young = gcs_are_young; 1041 _gcs_are_young = gcs_are_young;
1071 } 1042 }
1072 1043
1073 bool adaptive_young_list_length() { 1044 bool adaptive_young_list_length() {
1074 return _young_gen_sizer->adaptive_young_list_length(); 1045 return _young_gen_sizer->adaptive_young_list_length();
1075 }
1076
1077 inline double get_gc_eff_factor() {
1078 double ratio = _known_garbage_ratio;
1079
1080 double square = ratio * ratio;
1081 // square = square * square;
1082 double ret = square * 9.0 + 1.0;
1083 #if 0
1084 gclog_or_tty->print_cr("ratio = %1.2lf, ret = %1.2lf", ratio, ret);
1085 #endif // 0
1086 guarantee(0.0 <= ret && ret < 10.0, "invariant!");
1087 return ret;
1088 } 1046 }
1089 1047
1090 private: 1048 private:
1091 // 1049 //
1092 // Survivor regions policy. 1050 // Survivor regions policy.