Set an upper limit of 8G for the suggested memory

This commit is contained in:
Glavo 2022-01-12 17:28:00 +08:00 committed by Yuhui Huang
parent f1e4e3c753
commit 7beef30d20

View File

@ -180,7 +180,7 @@ public enum OperatingSystem {
.map(bytes -> (int) (bytes / 1024 / 1024))
.orElse(1024);
SUGGESTED_MEMORY = (int) (Math.round(1.0 * TOTAL_MEMORY / 4.0 / 128.0) * 128);
SUGGESTED_MEMORY = TOTAL_MEMORY >= 32768 ? 8192 : (int) (Math.round(1.0 * TOTAL_MEMORY / 4.0 / 128.0) * 128);
// setup the invalid names
if (CURRENT_OS == WINDOWS) {