comparison src/share/vm/gc_implementation/g1/concurrentMark.hpp @ 4095:bca17e38de00

6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads Summary: Select number of GC threads dynamically based on heap usage and number of Java threads Reviewed-by: johnc, ysr, jcoomes
author jmasa
date Tue, 09 Aug 2011 10:16:01 -0700
parents 4dfb2df418f2
children dc467e8b2c5e
comparison
equal deleted inserted replaced
4094:3a298e04d914 4095:bca17e38de00
373 373
374 protected: 374 protected:
375 ConcurrentMarkThread* _cmThread; // the thread doing the work 375 ConcurrentMarkThread* _cmThread; // the thread doing the work
376 G1CollectedHeap* _g1h; // the heap. 376 G1CollectedHeap* _g1h; // the heap.
377 size_t _parallel_marking_threads; // the number of marking 377 size_t _parallel_marking_threads; // the number of marking
378 // threads we'll use 378 // threads we're use
379 size_t _max_parallel_marking_threads; // max number of marking
380 // threads we'll ever use
379 double _sleep_factor; // how much we have to sleep, with 381 double _sleep_factor; // how much we have to sleep, with
380 // respect to the work we just did, to 382 // respect to the work we just did, to
381 // meet the marking overhead goal 383 // meet the marking overhead goal
382 double _marking_task_overhead; // marking target overhead for 384 double _marking_task_overhead; // marking target overhead for
383 // a single task 385 // a single task
471 double _total_counting_time; 473 double _total_counting_time;
472 double _total_rs_scrub_time; 474 double _total_rs_scrub_time;
473 475
474 double* _accum_task_vtime; // accumulated task vtime 476 double* _accum_task_vtime; // accumulated task vtime
475 477
476 WorkGang* _parallel_workers; 478 FlexibleWorkGang* _parallel_workers;
477 479
478 ForceOverflowSettings _force_overflow_conc; 480 ForceOverflowSettings _force_overflow_conc;
479 ForceOverflowSettings _force_overflow_stw; 481 ForceOverflowSettings _force_overflow_stw;
480 482
481 void weakRefsWork(bool clear_all_soft_refs); 483 void weakRefsWork(bool clear_all_soft_refs);
502 return _cleanup_list.is_empty(); 504 return _cleanup_list.is_empty();
503 } 505 }
504 506
505 // accessor methods 507 // accessor methods
506 size_t parallel_marking_threads() { return _parallel_marking_threads; } 508 size_t parallel_marking_threads() { return _parallel_marking_threads; }
509 size_t max_parallel_marking_threads() { return _max_parallel_marking_threads;}
507 double sleep_factor() { return _sleep_factor; } 510 double sleep_factor() { return _sleep_factor; }
508 double marking_task_overhead() { return _marking_task_overhead;} 511 double marking_task_overhead() { return _marking_task_overhead;}
509 double cleanup_sleep_factor() { return _cleanup_sleep_factor; } 512 double cleanup_sleep_factor() { return _cleanup_sleep_factor; }
510 double cleanup_task_overhead() { return _cleanup_task_overhead;} 513 double cleanup_task_overhead() { return _cleanup_task_overhead;}
511 514
706 ~ConcurrentMark(); 709 ~ConcurrentMark();
707 ConcurrentMarkThread* cmThread() { return _cmThread; } 710 ConcurrentMarkThread* cmThread() { return _cmThread; }
708 711
709 CMBitMapRO* prevMarkBitMap() const { return _prevMarkBitMap; } 712 CMBitMapRO* prevMarkBitMap() const { return _prevMarkBitMap; }
710 CMBitMap* nextMarkBitMap() const { return _nextMarkBitMap; } 713 CMBitMap* nextMarkBitMap() const { return _nextMarkBitMap; }
714
715 // Returns the number of GC threads to be used in a concurrent
716 // phase based on the number of GC threads being used in a STW
717 // phase.
718 size_t scale_parallel_threads(size_t n_par_threads);
719
720 // Calculates the number of GC threads to be used in a concurrent phase.
721 int calc_parallel_marking_threads();
711 722
712 // The following three are interaction between CM and 723 // The following three are interaction between CM and
713 // G1CollectedHeap 724 // G1CollectedHeap
714 725
715 // This notifies CM that a root during initial-mark needs to be 726 // This notifies CM that a root during initial-mark needs to be