提交 a0166f4d 编写于 作者: M mgronlun

8215284: Reduce noise induced by periodic task getFileSize()

Reviewed-by: redestad, egahlin
上级 e1f1cc9d
......@@ -517,4 +517,11 @@ public final class JVM {
* @param emitAll emit all samples in old object queue
*/
public native void emitOldObjectSamples(long cutoff, boolean emitAll);
/**
* Test if a chunk rotation is warranted.
*
* @return if it is time to perform a chunk rotation
*/
public native boolean shouldRotateDisk();
}
......@@ -428,19 +428,13 @@ public final class PlatformRecorder {
}
private void periodicTask() {
if (!jvm.hasNativeJFR()) {
return;
}
while (true) {
synchronized (this) {
if (!jvm.hasNativeJFR()) {
return;
}
if (currentChunk != null) {
try {
if (SecuritySupport.getFileSize(currentChunk.getUnfishedFile()) > Options.getMaxChunkSize()) {
rotateDisk();
}
} catch (IOException e) {
Logger.log(JFR_SYSTEM, WARN, "Could not check file size to determine chunk rotation");
}
if (jvm.shouldRotateDisk()) {
rotateDisk();
}
}
long minDelta = RequestEngine.doPeriodic();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册