Skip to content

Commit

Permalink
use static max heap threshold 100
Browse files Browse the repository at this point in the history
Signed-off-by: Xun Zhang <[email protected]>
  • Loading branch information
Zhangxunmt committed Jul 16, 2024
1 parent 0d89332 commit d14443d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class MemoryCircuitBreaker extends ThresholdCircuitBreaker<Short> {
// TODO: make this value configurable as cluster setting
private static final String ML_MEMORY_CB = "Memory Circuit Breaker";
public static final short DEFAULT_JVM_HEAP_USAGE_THRESHOLD = 85;
public static final short JVM_HEAP_MAX_THRESHOLD = 100; // when threshold is 100, this CB check is ignored
private final JvmService jvmService;
private volatile Integer jvmHeapMemThreshold = 85;

Expand Down Expand Up @@ -50,6 +51,6 @@ public Short getThreshold() {

@Override
public boolean isOpen() {
return getThreshold() < 100 && jvmService.stats().getMem().getHeapUsedPercent() > getThreshold();
return getThreshold() < JVM_HEAP_MAX_THRESHOLD && jvmService.stats().getMem().getHeapUsedPercent() > getThreshold();
}
}

0 comments on commit d14443d

Please sign in to comment.