diff --git a/server/src/main/java/org/opensearch/search/backpressure/trackers/HeapUsageTracker.java b/server/src/main/java/org/opensearch/search/backpressure/trackers/HeapUsageTracker.java index 0e75046b077f0..5cc612257207b 100644 --- a/server/src/main/java/org/opensearch/search/backpressure/trackers/HeapUsageTracker.java +++ b/server/src/main/java/org/opensearch/search/backpressure/trackers/HeapUsageTracker.java @@ -107,7 +107,7 @@ public static boolean isHeapTrackingSupported() { */ public static boolean isHeapUsageDominatedBySearch(List cancellableTasks, double heapPercentThreshold) { long usage = cancellableTasks.stream().mapToLong(task -> task.getTotalResourceStats().getMemoryInBytes()).sum(); - long threshold = (long) heapPercentThreshold * HEAP_SIZE_BYTES; + long threshold = (long) (heapPercentThreshold * HEAP_SIZE_BYTES); if (isHeapTrackingSupported() && usage < threshold) { logger.debug("heap usage not dominated by search requests [{}/{}]", usage, threshold); return false;