NOTICE: This website will be shut down in the near future. Product content has moved to nxp.com. Forum content and FAQs have been moved to community.nxp.com. We encourage you to create a user account on nxp.com to use the new community forums and access NXP microcontroller content. We greatly appreciate your contributions and look forward to seeing you at our new web location.

 

Increasing the memory available to Java

lpcxpresso-support's picture

The LPCXpresso IDE is a Java application. While running the IDE, Java may report various errors that are related to the amount of memory available to the Java runtime. You may find these errors listed in the log file (<workspace>/.metadata/.log) The errors are typically caused by having additional plugins installed into the IDE or by having a large number of projects and/or files in your workspace.

This FAQ shows how to increase the amount of Java memory available for each error type.

The INI file


When the IDE starts, it loads Java configuration information from the ini file. The locations and name of this file depends on the IDE being run:

  • LPCXPresso
    • <install>/lpcxpresso/lpcxpresso.ini

 

Java PermGen space (Out of Memory errors)


If you see java.lang.OutOfMemoryError: PermGen space errors, you need to increase the permanent generation (PermGen) space available to Eclipse.

To increase the PermGen size, edit the ini file, and add/edit the following line AFTER the -vmargs argument :

-XX:MaxPermSize=256M

Notes:

  1. If your IDE is already using these (or higher) settings, you can simply increase the sizes.

 

Java Heap Space (Heap errors)


If the LPCXpressoIDE starts reporting "Java Heap errors", or the IDE is frequently hourglassing, you will need to increase the Java Heap size.

To increase the Java heap size, edit the ini file, and add/edit the following lines (it is important that they are on separate lines}:

-vmargs
-Xms128m
-Xmx512m

Notes:

  1. If your IDE is already using these (or higher) settings, you can simply increase the sizes.
  2. The value for -Xmx must always be greater than or equal to the value for -Xms. Thus if you use -Xms512m, you must also set -Xmx512m.

After making these changes, you will need to close the IDE and restart.

You may also wish to enable the workspace preference such that the Java heap status is displayed in the IDE status bar (bottom right of Window). To do this, select:

Window -> Preferences -> General -> Show heap status

 

More information


Description of the arguments:

  • -Xms128m This defines the initial amount of heap space available to the Java runtime. This is dynamically allocated space and you should increase if you have a large number of files or projects in your workspace. The default is normally 128m; 256m would make it 256Mb.

  • -Xmx512m This defines the maximum amount of Heap space available to Java. This value must be greater than or equal to the value used in -Xms

A full discussion on the options available in the file can be found here: http://wiki.eclipse.org/Eclipse.ini

0
Your rating: None
feedback