Reserve 1G before computing heap size when it is given in percentage.
@@ -75,6 +75,9 @@ configure_memory() {
available_cgroup=$((available_cgroup_bytes >> 20))
available=$((available > available_cgroup ? available_cgroup : available))
fi
+ #Subtract 1G as fixed overhead for an application container.
+ reserved_mem = 1024
+ available=$((available > reserved_mem ? available - reserved_mem : available))
jvm_heapsize=$((available * jvm_heapSizeAsPercentageOfPhysicalMemory / 100))
jvm_minHeapsize=${jvm_heapsize}
