--- old/src/share/vm/logging/logFileOutput.cpp 2015-11-05 12:23:45.253254578 +0900 +++ new/src/share/vm/logging/logFileOutput.cpp 2015-11-05 12:23:45.110254994 +0900 @@ -155,12 +155,7 @@ int written = LogFileStreamOutput::write(decorations, msg); _current_size += written; - if (should_rotate()) { - MutexLockerEx ml(&_rotation_lock, true /* no safepoint check */); - if (should_rotate()) { - rotate(); - } - } + rotate(false); return written; } @@ -182,7 +177,14 @@ } } -void LogFileOutput::rotate() { +void LogFileOutput::rotate(bool force) { + + if (!should_rotate(force)) { + return; + } + + MutexLockerEx ml(&_rotation_lock, true /* no safepoint check */); + // Archive the current log file archive();