wood burning stoves 2.0*
The moose likes Java in General and the fly likes How to increase java Heap size ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to increase java Heap size ?" Watch "How to increase java Heap size ?" New topic

How to increase java Heap size ?

Sudha Ugendran

Joined: Oct 14, 2004
Posts: 9
I have got an 'Out of memory Exception'while trying to build using ANT.Inorder to solve this isssue,I think I need to increase the heap size.
Can anyone tell me how to increase the heap size of JVM or let me know if there is any other way of resolving this issue?

Thanks in advance

Thanks& Regards,
Sanju Thomas
Ranch Hand

Joined: Dec 29, 2004
Posts: 243
Use "-Xmx256m" to set the max memory size. "-Xmn256m" to set min memory size

If you enough memory in the machine, say 512 or above, then you can use aggressive heap. This can be used with jdk1.4 or above. So jvm will decide the heap size according to the free memory.

JAVA_OPTS="$JAVA_OPTS -XX:+AggressiveHeap"
Sanju Thomas
Ranch Hand

Joined: Dec 29, 2004
Posts: 243
I think it is "-Xms256m" instead of "-Xmn256m"
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12761
All these Java settings are documented in the tooldocs section of the SDK documentation. Unless you are working with limited disk space you really should have those docs on your hard drive.
wood burning stoves
subject: How to increase java Heap size ?
Similar Threads
Problem with inserting new data into database using hibernate
Command line options in TextPad
Java Memory Heap Exception
Text Pad 4.1
To increase heap size in java