502
503 // It should be called to indicate which phase we're in (concurrent
504 // mark or remark) and how many threads are currently active.
505 void set_concurrency_and_phase(uint active_tasks, bool concurrent);
506
507 // Prints all gathered CM-related statistics
508 void print_stats();
509
510 bool cleanup_list_is_empty() {
511 return _cleanup_list.is_empty();
512 }
513
514 // Accessor methods
515 uint parallel_marking_threads() const { return _parallel_marking_threads; }
516 uint max_parallel_marking_threads() const { return _max_parallel_marking_threads;}
517 double sleep_factor() { return _sleep_factor; }
518 double marking_task_overhead() { return _marking_task_overhead;}
519 double cleanup_sleep_factor() { return _cleanup_sleep_factor; }
520 double cleanup_task_overhead() { return _cleanup_task_overhead;}
521
522 bool use_parallel_marking_threads() const {
523 assert(parallel_marking_threads() <=
524 max_parallel_marking_threads(), "sanity");
525 assert((_parallel_workers == NULL && parallel_marking_threads() == 0) ||
526 parallel_marking_threads() > 0,
527 "parallel workers not set up correctly");
528 return _parallel_workers != NULL;
529 }
530
531 HeapWord* finger() { return _finger; }
532 bool concurrent() { return _concurrent; }
533 uint active_tasks() { return _active_tasks; }
534 ParallelTaskTerminator* terminator() { return &_terminator; }
535
536 // It claims the next available region to be scanned by a marking
537 // task/thread. It might return NULL if the next region is empty or
538 // we have run out of regions. In the latter case, out_of_regions()
539 // determines whether we've really run out of regions or the task
540 // should call claim_region() again. This might seem a bit
541 // awkward. Originally, the code was written so that claim_region()
542 // either successfully returned with a non-empty region or there
543 // were no more regions to be claimed. The problem with this was
544 // that, in certain circumstances, it iterated over large chunks of
545 // the heap finding only empty regions and, while it was working, it
546 // was preventing the calling task to call its regular clock
547 // method. So, this way, each task will spend very little time in
548 // claim_region() and is allowed to call the regular clock method
549 // frequently.
550 HeapRegion* claim_region(uint worker_id);
|
502
503 // It should be called to indicate which phase we're in (concurrent
504 // mark or remark) and how many threads are currently active.
505 void set_concurrency_and_phase(uint active_tasks, bool concurrent);
506
507 // Prints all gathered CM-related statistics
508 void print_stats();
509
510 bool cleanup_list_is_empty() {
511 return _cleanup_list.is_empty();
512 }
513
514 // Accessor methods
515 uint parallel_marking_threads() const { return _parallel_marking_threads; }
516 uint max_parallel_marking_threads() const { return _max_parallel_marking_threads;}
517 double sleep_factor() { return _sleep_factor; }
518 double marking_task_overhead() { return _marking_task_overhead;}
519 double cleanup_sleep_factor() { return _cleanup_sleep_factor; }
520 double cleanup_task_overhead() { return _cleanup_task_overhead;}
521
522 HeapWord* finger() { return _finger; }
523 bool concurrent() { return _concurrent; }
524 uint active_tasks() { return _active_tasks; }
525 ParallelTaskTerminator* terminator() { return &_terminator; }
526
527 // It claims the next available region to be scanned by a marking
528 // task/thread. It might return NULL if the next region is empty or
529 // we have run out of regions. In the latter case, out_of_regions()
530 // determines whether we've really run out of regions or the task
531 // should call claim_region() again. This might seem a bit
532 // awkward. Originally, the code was written so that claim_region()
533 // either successfully returned with a non-empty region or there
534 // were no more regions to be claimed. The problem with this was
535 // that, in certain circumstances, it iterated over large chunks of
536 // the heap finding only empty regions and, while it was working, it
537 // was preventing the calling task to call its regular clock
538 // method. So, this way, each task will spend very little time in
539 // claim_region() and is allowed to call the regular clock method
540 // frequently.
541 HeapRegion* claim_region(uint worker_id);
|