How to Controlling Java heap size allocation

A Java virtual machine (JVM) is a virtual machine capable of executing Java bytecode. If we are using a 32bit OS, then the jvm can’t have more than 4GB of RAMJVM has a number of parameters that you can tune.1. –Xms The initial heap size for the JVM
2. –Xms The maximum heap size for the JVM
3. –Xmn The size of the heap for the young generation
4. –Xss Set java thread stack sizePermanent Space: It’s the third part of the memory. Here are stored classes, methods etc.

• -XX:PermSize: initial value
• -XX:MaxPermSize: max value

Ex. catalina.sh

JAVA_OPTS=”$JAVA_OPTS “”-server -Xss1024K -Xms1024m -Xmx1536m -XX:NewSize=256m -XX:+UseConcMarkSweepGC -XX:PermSize=128M -XX:MaxPermSize=256M

Leave a Reply