hotspot/src/share/vm/gc_interface/collectedHeap.cpp
changeset 11788 bef6166c683c
parent 11636 3c07b54482a5
child 12229 c34a85c8f5aa
equal deleted inserted replaced
11787:cfb5950b7706 11788:bef6166c683c
    60 void GCHeapLog::log_heap(bool before) {
    60 void GCHeapLog::log_heap(bool before) {
    61   if (!should_log()) {
    61   if (!should_log()) {
    62     return;
    62     return;
    63   }
    63   }
    64 
    64 
    65   jlong timestamp = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
    65   double timestamp = fetch_timestamp();
    66   MutexLockerEx ml(&_mutex, Mutex::_no_safepoint_check_flag);
    66   MutexLockerEx ml(&_mutex, Mutex::_no_safepoint_check_flag);
    67   int index = compute_log_index();
    67   int index = compute_log_index();
    68   _records[index].thread = NULL; // Its the GC thread so it's not that interesting.
    68   _records[index].thread = NULL; // Its the GC thread so it's not that interesting.
    69   _records[index].timestamp = timestamp;
    69   _records[index].timestamp = timestamp;
    70   _records[index].data.is_before = before;
    70   _records[index].data.is_before = before;
    71   stringStream st(_records[index].data.buffer(), _records[index].data.size());
    71   stringStream st(_records[index].data.buffer(), _records[index].data.size());
    72   if (before) {
    72   if (before) {
    73     Universe::print_heap_before_gc(&st);
    73     Universe::print_heap_before_gc(&st, true);
    74   } else {
    74   } else {
    75     Universe::print_heap_after_gc(&st);
    75     Universe::print_heap_after_gc(&st, true);
    76   }
    76   }
    77 }
    77 }
    78 
    78 
    79 // Memory state functions.
    79 // Memory state functions.
    80 
    80