How to Increase JVM / Java Heap Size,Increasing JVM / Java Heap Size Tutorial

Java programs executes in JVM uses Heap of memory to manage the data. If your Java program requires a large amount of memory, it is possible that the virtual machine will begin to throw OutOfMemoryError instances when attempting to instantiate an object. The default heap size if 1 MB and can increase as much as 16 MB.

It is possible to increase heap size allocated by the Java Virtual Machine (JVM) by using command line options.
Following are few options available to change Heap Size.

-Xms<size>        set initial Java heap size
-Xmx<size>        set maximum Java heap size
-Xss<size>        set java thread stack size
 
Also we can set the Minimum and Maximum Heap size
 
java -Xms64m -Xmx256m MyProgram

jvm out of memory error,Java Out of Memory

I have a question I'm hoping to get some help with.  I have an Oracle 8.1.7 database running on a unix server. The server is also running a java virtual machine. I don't know much about the jvm, but i do know one is running. i have to have it running to run a pl/sql process that uses the oracle xdk package. when i try to run my process with too many reports to parse, i get the error:

ORA-29554: unhandled Java out of memory condition

i assume this means that the jvm ran out of available ram. my question is, does anyone know the details of how to up the memory avaialable to the jvm on the server? if anybody has another opinion on what exactly is causing this error and how to fix it that would be great too. thanks.


Solution:
take a look at that and try setting the two parameters in the init.ora file:

Oracle introduced the following two new init.ora parameters to limit Java  session memory usage:

JAVA_SOFT_SESSIONSPACE_LIMIT  - This parameter allows you to specify a soft limit on the amount of Java         memory usage in a session. If this parameter is exceeded, a message is written to the alert.log. The default is 1 MB.  
JAVA_MAX_SESSIONSPACE_SIZE   - This parameter sets a hard limit on the amount of Java memory usage a  session can have. If a session exceeds this parameter, it terminates  with the following error: ORA-29554 : unhandled Java out of memory condition
The default is 4 GB.  This limit was purposely set very high so that it would not normally be visible.