Skip to content

Instantly share code, notes, and snippets.

@joshkitt
Last active July 21, 2021 16:58
Show Gist options
  • Save joshkitt/3a8866967f856ddcf0aea90d4a702a3b to your computer and use it in GitHub Desktop.
Save joshkitt/3a8866967f856ddcf0aea90d4a702a3b to your computer and use it in GitHub Desktop.
JVM Memory
Maximum heap size:
If physical memory size is up to 192 megabytes (MB) then default maximum heap size is half of the physical memory.
If physical memory size is more than 192 megabytes then default maximum heap size is one fourth of the physical memory.
Initial heap size: At least 8 MB or 1/64th of physical memory up to a physical memory size of 1 GB.
java -XX:+PrintFlagsFinal -version | grep HeapSize
The default thread stack size varies with JVM, OS and environment variables.
java -XX:+PrintFlagsFinal -version | grep ThreadStackSize
JVM arguments (example)
-Xms2048m -Xmx4096m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment