8076076: Move SharedHeap::print_size_transition() into G1 code

Reviewed-by: tschatzl, mgerdin
This commit is contained in:
Bengt Rutisson 2015-03-27 09:28:47 +01:00
parent 2c63bc9175
commit fd46a24a3e
5 changed files with 17 additions and 32 deletions

View file

@ -2088,10 +2088,7 @@ void ConcurrentMark::cleanup() {
_cleanup_times.add((end - start) * 1000.0); _cleanup_times.add((end - start) * 1000.0);
if (G1Log::fine()) { if (G1Log::fine()) {
g1h->print_size_transition(gclog_or_tty, g1h->g1_policy()->print_heap_transition(start_used_bytes);
start_used_bytes,
g1h->used(),
g1h->capacity());
} }
// Clean up will have freed any regions completely full of garbage. // Clean up will have freed any regions completely full of garbage.

View file

@ -1201,11 +1201,21 @@ void G1CollectorPolicy::record_heap_size_info_at_start(bool full) {
} }
} }
void G1CollectorPolicy::print_heap_transition(size_t bytes_before) {
size_t bytes_after = _g1->used();
size_t capacity = _g1->capacity();
gclog_or_tty->print(" " SIZE_FORMAT "%s->" SIZE_FORMAT "%s(" SIZE_FORMAT "%s)",
byte_size_in_proper_unit(bytes_before),
proper_unit_for_byte_size(bytes_before),
byte_size_in_proper_unit(bytes_after),
proper_unit_for_byte_size(bytes_after),
byte_size_in_proper_unit(capacity),
proper_unit_for_byte_size(capacity));
}
void G1CollectorPolicy::print_heap_transition() { void G1CollectorPolicy::print_heap_transition() {
_g1->print_size_transition(gclog_or_tty, print_heap_transition(_heap_used_bytes_before_gc);
_heap_used_bytes_before_gc,
_g1->used(),
_g1->capacity());
} }
void G1CollectorPolicy::print_detailed_heap_transition(bool full) { void G1CollectorPolicy::print_detailed_heap_transition(bool full) {

View file

@ -700,6 +700,8 @@ public:
void record_heap_size_info_at_start(bool full); void record_heap_size_info_at_start(bool full);
// Print heap sizing transition (with less and more detail). // Print heap sizing transition (with less and more detail).
void print_heap_transition(size_t bytes_before);
void print_heap_transition(); void print_heap_transition();
void print_detailed_heap_transition(bool full = false); void print_detailed_heap_transition(bool full = false);

View file

@ -102,17 +102,3 @@ void SharedHeap::post_initialize() {
} }
void SharedHeap::ref_processing_init() {} void SharedHeap::ref_processing_init() {}
// Some utilities.
void SharedHeap::print_size_transition(outputStream* out,
size_t bytes_before,
size_t bytes_after,
size_t capacity) {
out->print(" " SIZE_FORMAT "%s->" SIZE_FORMAT "%s(" SIZE_FORMAT "%s)",
byte_size_in_proper_unit(bytes_before),
proper_unit_for_byte_size(bytes_before),
byte_size_in_proper_unit(bytes_after),
proper_unit_for_byte_size(bytes_after),
byte_size_in_proper_unit(capacity),
proper_unit_for_byte_size(capacity));
}

View file

@ -214,16 +214,6 @@ public:
// Sets the number of parallel threads that will be doing tasks // Sets the number of parallel threads that will be doing tasks
// (such as process roots) subsequently. // (such as process roots) subsequently.
virtual void set_par_threads(uint t); virtual void set_par_threads(uint t);
//
// New methods from CollectedHeap
//
// Some utilities.
void print_size_transition(outputStream* out,
size_t bytes_before,
size_t bytes_after,
size_t capacity);
}; };
#endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP #endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP