How JVM -XX:MaxRAM option can be correctly used? [duplicate]
问题 This question already has answers here : Setting -XX:MaxRam (3 answers) Closed last month . I run a java application with the following parameters: #!/bin/bash export JVM_OPTS="-XX:MaxRAM=150m" export JVM_OPTS="$JVM_OPTS -XX:+UseSerialGC" java $JVM_OPTS -jar application.jar The htop shows: VIRT=475M RES=238M SHR=4880 MEM%=24.1 As I understand it, I need to look at the RES parameter. But in this case, it greatly exceeds -XX:MaxRAM . Expected that in this case, OutOfMemoryException will happen.