Java Memory Management

You might think that if you are programming in Java, what do you need to know about how memory works? Java has automatic memory management, a nice and quiet garbage collector that works in the background to clean up the unused objects and free up some memory.

Therefore, you as a Java programmer do not need to bother yourself with problems like destroying objects, as they are not used anymore. However, even if this process is automatic in Java, it does not guarantee anything. By not knowing how the garbage collector and Java memory is designed, you could have objects that are not eligible for garbage collecting, even if you are no longer using them.

Difference Between InitialRAMPercentage, MinRAMPercentage, MaxRAMPercentage

This article attempts to clarify the difference between InitialRAMPercentage, MinRAMPercentage, MaxRAMPercentage JVM arguments. These arguments have been introduced since Java 8 update 191. They are used to configure your Java application’s heap size when you are running it in the Physical server or in the container. In this article, let’s review their differences.

InitialRAMPercentage

‘-XX:InitialRAMPercentage’ is used to compute the initial heap size of your java application. Say suppose you are configuring -XX:InitialRAMPercentage=25 and overall physical memory (or container memory) is 1GB then your java application’s heap size will be ~250MB (i.e., 25% of 1GB).