int (boolean memoryLow, VMOptions.MemoryKind option) { var current = VMOptions.readOption(option, true); var suggested = 0; if (memoryLow && option == VMOptions.MemoryKind.HEAP) { var cap = Registry.intValue("max.suggested.heap.size"); if (current > 0) { suggested = current + HEAP_INCREMENT; if (suggested > cap) suggested = Math.max(cap, current); } else { suggested = cap; } } else { suggested = VMOptions.readOption(option, false); if (suggested <= 0) suggested = current; if (suggested <= 0) suggested = MIN_VALUE; } return suggested; }