MPLAB® X IDE JVM Configuration Options

MPLAB® X IDE provides a default configuration for the Java Virtual Machine (JVM) that should be optimal for the vast majority of users. This information is provided for those rare circumstances where specialized settings are required.

MPLAB X IDE Version 2.15 and Later

Windows: C:\Program Files\Microchip\MPLABX\mplab_ide\etc\mplab_ide.conf
Windows (64-bit): C:\Program Files (x86)\Microchip\MPLABX\mplab_ide\etc\mplab_ide.conf
Linux: /opt/microchip/mplab_ide/etc/mplab_ide.conf
Mac OSX: /Applications/microchip/mplabx/mplab_ide.app/Contents/Resources/mplab_ide/etc/mplab_ide.conf

Windows (64-bit)/Linux

In the default_options parameter of mplab_ide.conf, the Xmx option specifying the max heap space (the max amount of memory MPLAB® X IDE can use) is not included. This is because the JRE itself, will look at the environment where it is being run and will select an appropriate value. This value is typically 1/4 of the max amount of memory in the system. If you want to allocate a larger value for the max heap size for MPLAB X IDE you can add -J-XmxVALUE. For example, -J-Xmx4096m will make the upper limit be 4 gigabytes.

Windows (32-bit)

On versions 2.15 and 2.20, if you experience sluggish behavior with MPLAB X IDE and choose to modify this -J-Xmx, keep it around 512m for best results. On 64-bit systems, the JRE automatically assigns a heap space of 1/4 of available memory. Unfortunately, on the 32-bit version of the JRE (Java Runtime Environment) this is not the case. Setting the -J-Xmx value too high can cause the IDE to fail to launch. Setting -J-Xmx512m is fairly safe, but 600m and above starts to cause problems. The issue is that it can be difficult to find a contiguous block of available memory that large on 32-bit systems. On version 2.25 and above, we have put -J-Xmx512m into mplab_ide.conf by default for all 32-bit systems.

Mac OSX

You may change the upper value of Xmx below to increase the max amount of memory used by MPLAB X IDE. In some older versions of the JRE6 we saw some issues when allocating more memory than the current default of -J-Xmx512m (512 mega bytes). But with the latest release of JRE6 this has been fixed. So you can add -J-XmxVALUE. For example, -J-Xmx4096m will make the upper limit be 4 gigabytes.

MPLAB X IDE Version 2.10 and Earlier

Windows: C:\Program Files\Microchip\MPLABX\mplab_ide\etc\mplab_ide.conf
Windows (64-bit): C:\Program Files (x86)\Microchip\MPLABX\mplab_ide\etc\mplab_ide.conf
Linux: /opt/microchip/mplab_ide/etc/mplab_ide.conf
Mac OSX: /Applications/microchip/mplabx/mplab_ide.app/Contents/Resources/mplab_ide/etc/mplab_ide.conf

Tweak 1: Modifying the default_options parameter

Edit the default_options parameter in mplab_ide.conf:

default_options="--branding mplab -J-Xms384m -J-Xmx512m -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled"

You can experiment with increasing the Xms and Xmx parameters depending on how much memory you have installed in your system and how many other applications you are running concurrently (i.e. -J-Xms256m -J-Xmx384m OR -J-Xms384m -J-Xmx512m). There is a maximum limit depending on the version of JVM you have installed.

-J-Xmsn: Initial size (in bytes) of the memory allocation pool. This value must be a multiple of 1024 greater than 1MB. The letter k, K, m, or M may be appended to indicate kilobytes or megabytes.

-J-Xmxn: Maximum size (in bytes) of the memory allocation pool. This value must a multiple of 1024 greater than 2MB. The letter k, K, m, or M may be appended to indicate kilobytes or megabytes.

-J-XX:+UseConcMarkSweepGC: Forces JVM to use a different algorithm for garbage collection that is less likely to cause intrusive pauses.

-J-XX:+CMSClassUnloadingEnabled: Enables class unloading when using the -J-XX:+UseConcMarkSweepGC option which doesn't enable it by default.


Reference: Tuning JVM switches for performance

© 2016 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.