Search code examples
javaintellij-ideajvmheap-memoryjvm-arguments

Configure initial heap size for java 8 VM


I try to set initial application memory heap size to 2gb for java 8 VM. I add -Xms2g -Xmx2g in Program Arguments section of IntelliJ.

enter image description here

Then I start my application and see that the heap size is less than 1gb. enter image description here

What do I miss?


Solution

  • The "Program arguments" are the arguments passed to your main method, not to Java itself. Move these arguments to the "VM options" box.