junegunn commented on code in PR #7076: URL: https://github.com/apache/hbase/pull/7076#discussion_r2145251529
########## hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemoryManager.java: ########## @@ -241,6 +238,15 @@ public float getHeapOccupancyPercent() { : this.heapOccupancyPercent; } + private boolean isHeapMemoryUsageExceedingLimit(float memStoreFraction, + float blockCacheFraction) { + int memStorePercent = (int) (memStoreFraction * CONVERT_TO_PERCENTAGE); + int blockCachePercent = (int) (blockCacheFraction * CONVERT_TO_PERCENTAGE); + int minFreeHeapPercent = (int) (this.minFreeHeapFraction * CONVERT_TO_PERCENTAGE); + + return memStorePercent + blockCachePercent + minFreeHeapPercent > CONVERT_TO_PERCENTAGE; Review Comment: How about we just compare the sum of the float values against 1? ```suggestion return memStoreFraction + blockCacheFraction + minFreeHeapFraction > 1; ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org