522 _workers->run_task(&task); |
522 _workers->run_task(&task); |
523 } |
523 } |
524 |
524 |
525 void ShenandoahHeap::print_on(outputStream* st) const { |
525 void ShenandoahHeap::print_on(outputStream* st) const { |
526 st->print_cr("Shenandoah Heap"); |
526 st->print_cr("Shenandoah Heap"); |
527 st->print_cr(" " SIZE_FORMAT "K total, " SIZE_FORMAT "K committed, " SIZE_FORMAT "K used", |
527 st->print_cr(" " SIZE_FORMAT "%s total, " SIZE_FORMAT "%s committed, " SIZE_FORMAT "%s used", |
528 max_capacity() / K, committed() / K, used() / K); |
528 byte_size_in_proper_unit(max_capacity()), proper_unit_for_byte_size(max_capacity()), |
529 st->print_cr(" " SIZE_FORMAT " x " SIZE_FORMAT"K regions", |
529 byte_size_in_proper_unit(committed()), proper_unit_for_byte_size(committed()), |
530 num_regions(), ShenandoahHeapRegion::region_size_bytes() / K); |
530 byte_size_in_proper_unit(used()), proper_unit_for_byte_size(used())); |
|
531 st->print_cr(" " SIZE_FORMAT " x " SIZE_FORMAT"%s regions", |
|
532 num_regions(), |
|
533 byte_size_in_proper_unit(ShenandoahHeapRegion::region_size_bytes()), |
|
534 proper_unit_for_byte_size(ShenandoahHeapRegion::region_size_bytes())); |
531 |
535 |
532 st->print("Status: "); |
536 st->print("Status: "); |
533 if (has_forwarded_objects()) st->print("has forwarded objects, "); |
537 if (has_forwarded_objects()) st->print("has forwarded objects, "); |
534 if (is_concurrent_mark_in_progress()) st->print("marking, "); |
538 if (is_concurrent_mark_in_progress()) st->print("marking, "); |
535 if (is_evacuation_in_progress()) st->print("evacuating, "); |
539 if (is_evacuation_in_progress()) st->print("evacuating, "); |
959 private: |
963 private: |
960 void do_work() { |
964 void do_work() { |
961 ShenandoahConcurrentEvacuateRegionObjectClosure cl(_sh); |
965 ShenandoahConcurrentEvacuateRegionObjectClosure cl(_sh); |
962 ShenandoahHeapRegion* r; |
966 ShenandoahHeapRegion* r; |
963 while ((r =_cs->claim_next()) != NULL) { |
967 while ((r =_cs->claim_next()) != NULL) { |
964 assert(r->has_live(), "all-garbage regions are reclaimed early"); |
968 assert(r->has_live(), "Region " SIZE_FORMAT " should have been reclaimed early", r->region_number()); |
965 _sh->marked_object_iterate(r, &cl); |
969 _sh->marked_object_iterate(r, &cl); |
966 |
970 |
967 if (ShenandoahPacing) { |
971 if (ShenandoahPacing) { |
968 _sh->pacer()->report_evac(r->used() >> LogHeapWordSize); |
972 _sh->pacer()->report_evac(r->used() >> LogHeapWordSize); |
969 } |
973 } |