Profile Image

What is Memory tuning: -XX:InitialHeapSize?

What is Memory tuning: -XX:InitialHeapSize? Have you used this JVM argument before? What are the pros & cons of using this Java argument? Can you share your perspective/experience in using this JVM argument?

  • jvmargument

  • xx-initialheapsize

  • x-initialheapsize

  • Memory tuning

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky



You can set the initial size (in bytes) of the memory allocation pool:


-XX:InitialHeapSize=size[units], where size is the amount of memory in bytes of  your choice.




To set the size of allocated memory to 6 MB using various units:








Sets the initial size (in bytes) of the memory allocation pool. This value must be either 0, or a multiple of 1024 and greater than 1 MB. Append the letter k or K to indicate kilobytes, m or M to indicate megabytes, or g or G to indicate gigabytes. The default value is selected at run time based on the system configuration. If you set this option to 0, then the initial size is set as the sum of the sizes allocated for the old generation and the young generation. The size of the heap for the young generation can be set using the -XX:NewSize option.


Default Value:


Default value is 45






Arguments related:


TODO link MaxHeapSize, MinHeapFreeRatio, MaxHeapFreeRatio, Xmx, Xms, NewSize


Related Posts:



If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your insights will help the entire 10+ million java developer community to develop one standard source of documentation for all the JVM arguments.

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • jvmargument

  • xx-initialheapsize

  • x-initialheapsize

  • Memory tuning