<-- Back

OutOfMemoryError: Java heap space when running app locally

Issue

When running an application locally, the following error is shown:

opening JDBC connection to default failed with SQLState: S1000 Error code: -458 Message: "java.lang.OutOfMemoryError: Java heap space", retrying...(1/4)

Environment

Studio Pro (all versions)

Solution/Workaround

To solve this error, please check the following: 

  1.  
    1.  Confirm the laptop meets hardware requirements.
    2. Update the JDK to use Version 21 since there are performance improvements associated with Java 21. Download the Java 21 from here. Select Java 21 under App Explorer SettingsRuntime
    3. Increase the Java Heap value:
      1. From App Explorer, open the Settings tab
      2. Click New
      3. Select the Server tab under the New Configuration window
      4. Select Custom and enter the value of the Maximum size (in MB)

If the above suggestions do not help, then there is likely an issue in the application development that has caused the heap to go OOM. Try adding the following to the Extra JVM Parameters under Server Configurations. See the JVM parameters documentation.

-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=path/on/your/system/hdump.hprof

The above line of code will generate a heap dump that will be saved wherever specified, so the path should be updated appropriately. The heap dump can then be used to check why the heap is going OOM from a code perspective. 

Internal information related

  • 231858

Additional information 

Mendix Documentation: JVM parameters

 

 

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.

To provide feedback, please open a ticket here. Don't forget to include the article's URL along with the feedback you would like to provide.