SQL-Developer: How to prevent the “Java Heap Space” error

When you are working with a lot of worksheets and reports or try to open large SQL files, you may run into “Java Heap Space” errors.

To fix this problem you need to increase the Xmx (maximum heap size).

Here is how:

  1. Close all open SQL-Developer instances.
  2. Find the “sqldeveloper.conf” file
    1. Windows:
      1. goto the directory where the SQL-Developer program is installed.
      2. goto the subdirectory “sqldeveloper\bin”
    2. Mac OS X:
      1. goto your applications folder (“/Applications”)
      2. open the SQLDeveloper-App via context menu (“right mouse click”)
      3. goto the subdirectory “Contents/Resources/sqldeveloper/sqldeveloper/bin”
  3. Open the file “sqldeveloper.conf” with the text editor of your choise.
  4. Add a new line with the following text to the file:
    AddVMOption -Xmx1024M
  5. Save the file.
Advertisements

6 thoughts on “SQL-Developer: How to prevent the “Java Heap Space” error

      • Hello,

        If you are using SQL Developer, first check the SQL Array Fetch Size, which has to be smaller then the memory allocated in AddVMOption.

        SQL Array Fetch size can be found under Tools -> Preferences -> Database -> Advance

        Like

  1. The location on Mac OS seems to have changed for version 4.1 and above the product.conf file can be found in a hidden directory under /users/.sqldeveloper/4.1.0/

    Like

  2. I have made the changes all mentioned above but still not able to load.
    and now getting error message like…..cannot not be opened due to the following error:0

    Changes Made Java Hear error
    1. I closed file sql files and exit from SQl developer.
    2. Made changes in sqldeveloper.conf by adding AddVMOption -Xmx1024M
    and save it.
    3.SQL Array Fetch size can be found under Tools -> Preferences -> Database -> Advance

    Array Fetch size is 50

    Like

  3. Hi,

    Now Java heap error is not showing but getting error message like…..cannot not be opened due to the following error:0
    Changes made to resolve the Java heap error
    1. I closed file sql files and exit from SQl developer.
    2. Made changes in sqldeveloper.conf by adding AddVMOption -Xmx1024M
    and save it.
    3. SQL Array Fetch size can be found under Tools -> Preferences -> Database -> Advance
    Array Fetch size 50.

    Like

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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