Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java.lang.OutOfMemory Java Heap Space JDeveloper

I am writing an application on Java and it is throwing this error Java.lang.OutOfMemory Java Heap Space JDeveloper. I know that I can add java -Xmx512m to the command line to solve the problem. However, I need to run this application on JDeveloper. So, my Question is:

How to increase the size of the Heap on JDveloper?

Thank you, Sami

like image 803
Sami Avatar asked Aug 09 '10 16:08

Sami


1 Answers

Overview

The reasons JDeveloper can run out of memory include heap limits and large files.

Heap Limits

Files that control the amount of memory afforded to the JVM for JDeveloper upon startup, relative to the jdeveloper/ide/bin/ directory, include:

  • jdev.conf
  • ide.conf

Update these files as follows:

  1. Quit JDeveloper.
  2. Edit ide.conf.
  3. Append the following
    AddVMOption -Xms256M
    AddVMOption -Xmx1024M
    
  4. Edit jdev.conf.
  5. Find the AddVMOption for the "heap size."
  6. Change the values as follows:
    AddVMOption -Xmx1024M
    AddVMOption -XX:MaxPermSize=1024M
    

Large Files

JDeveloper naïvely attempts to parse files having known file extensions that are located in the project's root level directory. A sufficiently large file, such as a 3GB XML file, will cause problems. To work around this issue, create a subdirectory for the large data and move the file into it. JDeveloper will not try to find resources in arbitrary subdirectories.

like image 176
KristofMols Avatar answered Oct 12 '22 20:10

KristofMols