Conventionally when being run, Eclipse assigns a heap of 256MB to a Java virtual machine. In case the workspace contains large resources (their total size is over e.g. 1GB) after a longer work with MDT, the virtual machine may report our of memory error.
In case of large projects Eclipse Help suggests enlarging Java virtual machine heap do e.g. 512MB. It can be performed in two ways, and in both cases it is done by changing the following parameters:
- -Xms – decides about the initial heap size assigned to Java virtual machine (by default 40MB). If the heap appears to be too small in some moment, the virtual machine will be assigning a larger heap to itself till it reaches the size defined by -Xmx parameter.
- -Xmx – decides about the maximum heap size assigned to Java virtual machine (by default 256MB)
The -Xms and -Xmx values can be defined:
- In configuration file eclipse.ini. This file is placed in the same folder as eclipse.exe. Default content of the file is:
-vmargs
-Xms40m
-Xmx256m
Please note that each parameter in the file is placed in a separate line. - As launching parameters of eclipse.exe executable. For example:
eclipse.exe -vmargs -Xms128m -Xmx512m
PROBLEMS WITH LONG WORKSPACE REFRESHING DURING EVERY STARTUP
By default Eclipse refreshes all of the workspace resources during every startup. If user has linked core product folders (or any other large folders) to Magik projects then the refresh process may take a long time.
In order to omit that issue uncheck Refresh workspace on startup option in workspace preferences (Window->Preferences...->General->Startup and Shutdown).