713 }
714
715
716 size_t PSYoungGen::used_in_words() const {
717 return eden_space()->used_in_words()
718 + from_space()->used_in_words(); // to_space() is only used during scavenge
719 }
720
721
722 size_t PSYoungGen::free_in_words() const {
723 return eden_space()->free_in_words()
724 + from_space()->free_in_words(); // to_space() is only used during scavenge
725 }
726
727 void PSYoungGen::object_iterate(ObjectClosure* blk) {
728 eden_space()->object_iterate(blk);
729 from_space()->object_iterate(blk);
730 to_space()->object_iterate(blk);
731 }
732
733 void PSYoungGen::precompact() {
734 eden_mark_sweep()->precompact();
735 from_mark_sweep()->precompact();
736 to_mark_sweep()->precompact();
737 }
738
739 void PSYoungGen::adjust_pointers() {
740 eden_mark_sweep()->adjust_pointers();
741 from_mark_sweep()->adjust_pointers();
742 to_mark_sweep()->adjust_pointers();
743 }
744
745 void PSYoungGen::compact() {
746 eden_mark_sweep()->compact(ZapUnusedHeapArea);
747 from_mark_sweep()->compact(ZapUnusedHeapArea);
748 // Mark sweep stores preserved markOops in to space, don't disturb!
749 to_mark_sweep()->compact(false);
750 }
751
752 void PSYoungGen::print() const { print_on(tty); }
753 void PSYoungGen::print_on(outputStream* st) const {
754 st->print(" %-15s", "PSYoungGen");
755 st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
756 capacity_in_bytes()/K, used_in_bytes()/K);
757 virtual_space()->print_space_boundaries_on(st);
758 st->print(" eden"); eden_space()->print_on(st);
759 st->print(" from"); from_space()->print_on(st);
760 st->print(" to "); to_space()->print_on(st);
761 }
762
763 // Note that a space is not printed before the [NAME:
764 void PSYoungGen::print_used_change(size_t prev_used) const {
765 log_info(gc, heap)("%s: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)",
766 name(), prev_used / K, used_in_bytes() / K, capacity_in_bytes() / K);
767 }
768
769 size_t PSYoungGen::available_for_expansion() {
770 ShouldNotReachHere();
|
713 }
714
715
716 size_t PSYoungGen::used_in_words() const {
717 return eden_space()->used_in_words()
718 + from_space()->used_in_words(); // to_space() is only used during scavenge
719 }
720
721
722 size_t PSYoungGen::free_in_words() const {
723 return eden_space()->free_in_words()
724 + from_space()->free_in_words(); // to_space() is only used during scavenge
725 }
726
727 void PSYoungGen::object_iterate(ObjectClosure* blk) {
728 eden_space()->object_iterate(blk);
729 from_space()->object_iterate(blk);
730 to_space()->object_iterate(blk);
731 }
732
733 #if INCLUDE_SERIALGC
734
735 void PSYoungGen::precompact() {
736 eden_mark_sweep()->precompact();
737 from_mark_sweep()->precompact();
738 to_mark_sweep()->precompact();
739 }
740
741 void PSYoungGen::adjust_pointers() {
742 eden_mark_sweep()->adjust_pointers();
743 from_mark_sweep()->adjust_pointers();
744 to_mark_sweep()->adjust_pointers();
745 }
746
747 void PSYoungGen::compact() {
748 eden_mark_sweep()->compact(ZapUnusedHeapArea);
749 from_mark_sweep()->compact(ZapUnusedHeapArea);
750 // Mark sweep stores preserved markOops in to space, don't disturb!
751 to_mark_sweep()->compact(false);
752 }
753
754 #endif // INCLUDE_SERIALGC
755
756 void PSYoungGen::print() const { print_on(tty); }
757 void PSYoungGen::print_on(outputStream* st) const {
758 st->print(" %-15s", "PSYoungGen");
759 st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
760 capacity_in_bytes()/K, used_in_bytes()/K);
761 virtual_space()->print_space_boundaries_on(st);
762 st->print(" eden"); eden_space()->print_on(st);
763 st->print(" from"); from_space()->print_on(st);
764 st->print(" to "); to_space()->print_on(st);
765 }
766
767 // Note that a space is not printed before the [NAME:
768 void PSYoungGen::print_used_change(size_t prev_used) const {
769 log_info(gc, heap)("%s: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)",
770 name(), prev_used / K, used_in_bytes() / K, capacity_in_bytes() / K);
771 }
772
773 size_t PSYoungGen::available_for_expansion() {
774 ShouldNotReachHere();
|