Use direct memory instead of Heap to determine a broker is "overloaded" in memory usage
@@ -1062,13 +1062,15 @@ public class SimpleLoadManagerImpl implements LoadManager, ZooKeeperCacheListene
public static boolean isAboveLoadLevel(SystemResourceUsage usage, float thresholdPercentage) {
return (usage.bandwidthOut.percentUsage() > thresholdPercentage
|| usage.bandwidthIn.percentUsage() > thresholdPercentage
- || usage.cpu.percentUsage() > thresholdPercentage || usage.memory.percentUsage() > thresholdPercentage);
+ || usage.cpu.percentUsage() > thresholdPercentage
+ || usage.directMemory.percentUsage() > thresholdPercentage);
}
public static boolean isBelowLoadLevel(SystemResourceUsage usage, float thresholdPercentage) {
return (usage.bandwidthOut.percentUsage() < thresholdPercentage
&& usage.bandwidthIn.percentUsage() < thresholdPercentage
- && usage.cpu.percentUsage() < thresholdPercentage && usage.memory.percentUsage() < thresholdPercentage);
+ && usage.cpu.percentUsage() < thresholdPercentage
+ && usage.directMemory.percentUsage() < thresholdPercentage);
}
private static long getRealtimeJvmHeapUsageMBytes() {
