I have a VPS with 20GB RAM, Ubuntu OS. I am trying to allocate 10GB RAM as the maximum heap to java using JAVA_TOOL_OPTIONS but I couldn't. Please see the attached screenshot. It shows available memory as 17GB. Its working when I try to set to 7GB. But heap error occurs only when it is > 7GB. I have already installed glassfish and allocated 3Gb to its cluster. Its working fine. But why I am not able to allocate greater than 7GB when I have 17GB RAM free.
ULIMITS
OverCommit memory
My Hardware is Virtual Hosted. Below is the configuration
- Architecture: x86_64
- CPU op-mode(s): 32-bit, 64-bit
- Byte Order: Little Endian
- CPU(s): 16
- Vendor ID: GenuineIntel
- CPU family: 6
- Model: 26
- Stepping: 5
- CPU MHz: 2266.802
- BogoMIPS: 4533.60
- Virtualization: VT-x






java -version; i.e. what Java release / build are you using?sysctl vm_overcommit, try-XX:-UseLargePages