Increase Heap Memory For Java Applications

December 5, 2007 at 12:10 am (Java, Study Refers, Tips n Tricks)

Many times you may crack out with an error like
Out Of Memory…
while running your java application. This is because of your jvm’s bounded heap size. You can alter this heap size by adding an argument to the command
java -Xms
java -Xmx
java -Xss

eg. java -Xmx32m will set the maximum heap size as 32MB.

Java Compiler has also some defaults for heap. These are initially set to 1GB so there is no need to worry about that. Moreover compiler job is not rigorous till we run a big set of code.
Launcher has 128MB as the maximum heap size and is generally reconfigured for biggies.
So, adjust your heap size according to your hardware capacity for optimized performance. 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: