client_java
client_java copied to clipboard
TimeWindowQuantiles results in more frequent Full GC
I found the method of rotate() in TimeWindowQuantiles.class will update ringBuffer if timeout:
private CKMSQuantiles rotate() {
long timeSinceLastRotateMillis = System.currentTimeMillis() - lastRotateTimestampMillis;
while (timeSinceLastRotateMillis > durationBetweenRotatesMillis) {
ringBuffer[currentBucket] = new CKMSQuantiles(quantiles);
if (++currentBucket >= ringBuffer.length) {
currentBucket = 0;
}
timeSinceLastRotateMillis -= durationBetweenRotatesMillis;
lastRotateTimestampMillis += durationBetweenRotatesMillis;
}
return ringBuffer[currentBucket];
}
so when sliding window of time is set for a time greater than the number of minor GC executions, these sliding window of time will enter tenured, but after a while these sliding window of time will be garbage and increased the frequency of full GC especially when the number of label combinations is high. This situation is especially obvious in openj9. So are there any ways to prevent this from happening?
especially when the number of label combinations is high
I think this is the real issue here. You should attempt to reduce the label combinations to a reasonable number to avoid cardinality explosion. The default for the age of a time window is 10 minutes, and garbage collecting the time window every 10 minutes should not be an issue unless you have tens of thousands of time series in your Summary.