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 d6a38c8797174..bfc738351caf4 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;