--- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp Tue Apr 19 14:14:04 2016 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp Tue Apr 19 14:21:26 2016 +0200
@@ -146,11 +146,7 @@
_size_index = size_index;
_size = initial_size;
_entry_count = 0;
- if (TraceJVMTIObjectTagging) {
- _trace_threshold = initial_trace_threshold;
- } else {
- _trace_threshold = -1;
- }
+ _trace_threshold = initial_trace_threshold;
_load_factor = load_factor;
_resize_threshold = (int)(_load_factor * _size);
_resizing_enabled = true;
@@ -329,8 +325,7 @@
}
_entry_count++;
- if (trace_threshold() > 0 && entry_count() >= trace_threshold()) {
- assert(TraceJVMTIObjectTagging, "should only get here when tracing");
+ if (log_is_enabled(Debug, jvmti, objecttagging) && entry_count() >= trace_threshold()) {
print_memory_usage();
compute_next_trace_threshold();
}
@@ -409,6 +404,7 @@
// compute threshold for the next trace message
void JvmtiTagHashmap::compute_next_trace_threshold() {
+ _trace_threshold = entry_count();
if (trace_threshold() < medium_trace_threshold) {
_trace_threshold += small_trace_threshold;
} else {
@@ -3413,12 +3409,6 @@
delayed_add = next;
}
- // stats
- if (TraceJVMTIObjectTagging) {
- int post_total = hashmap->_entry_count;
- int pre_total = post_total + freed;
-
- tty->print_cr("(%d->%d, %d freed, %d total moves)",
- pre_total, post_total, freed, moved);
- }
+ log_debug(jvmti, objecttagging)("(%d->%d, %d freed, %d total moves)",
+ hashmap->_entry_count + freed, hashmap->_entry_count, freed, moved);
}