-Xms and -Xmx parameter

Yatin B.Yatin B.
1 min read

Date: 2022-08-22

This tutorial explains the Java Virtual Machine (JVM) parameters -Xmx and -Xms, which control the maximum and initial heap sizes, respectively. The Java heap stores application objects and is managed by garbage collection. Insufficient heap space leads to OutOfMemoryError. -Xmx sets the maximum heap size (e.g., -Xmx4g for 4GB), while -Xms sets the initial size (e.g., -Xms128m for 128MB). Exceeding -Xmx throws an error; for newer Java versions, increasing -XX:MaxMetaspaceSize might be necessary.

Read more: https://examples.javacodegeeks.com/what-is-xms-and-xmx-parameter/

0
Subscribe to my newsletter

Read articles from Yatin B. directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Yatin B.
Yatin B.