The following advice applies to yEd version 3.16 and before.
As of yEd version 3.16.1, the maximum heap space of the Java virtual machines that come bundled with yEd installers is not restricted anymore.
You can prevent 'Out of Memory' errors by extending the Java heap space for yEd.
yEd is a Java application and, as such, constrained by the Java Virtual Machine (JVM) it runs in. The JVM imposes a limit to the amount of memory that an application can use.
Even if your computer has more memory, yEd cannot use it, i.e., if yEd needs more memory than its limit, an OutOfMemoryError occurs with a message like "java heap space out of memory".
By default, the maximum amount of memory available to yEd is set to 512 MB (beginning with version 18.104.22.168; prior versions used 256 MB). This limit can be set to a different value at the startup of a Java application.
To increase this limit for yEd, do the following:
- If you used the yEd Installer for Windows, you can add a parameter to the link on the desktop.
- Right click on the yEd icon on the desktop to open the context menu and select the entry 'Properties'.
- In the field 'Target', add -J-Xmx768m to set the limit to 768 MB. Of course, you can use other values, too.
For example, the field's content should be similar to
"C:\Program Files\yWorks\yEd\yEd.exe" -J-Xmx768m
- Click 'OK' to close the dialog. If you subsequently start yEd by double clicking the link on the desktop, it will use up to 768 MB of memory.
- On Windows, you can also use this attached batch script to start yEd with custom parameters for Java's memory limit. Please have a look at the comments in the batch file which describe how to use it.
- If you used the yEd Installer for Mac OS X, you can adjust the Info.plist file in the yEd.app directory:
For the VMOptions key, use as the new value -Xmx768m instead of the original value.
As of yEd 3.13, additional options have to be placed in section [JVMOptions] of file yEd.app/Contents/Java/yEd.cfg.
As of yEd 22.214.171.124, additional options have to be placed in section [JavaOptions] of file yEd.app/Contents/app/yEd.cfg.
As of yEd 3.21, entries in section [JavaOptions] of file yEd.app/Contents/app/yEd.cfg have to be prefixed with java-options=, e.g.
- On Linux, open the yEd shell script, which is located in the yEd installation directory, in a text editor. Go to the second to last line and find "-Xmx512m". Change 512 to a higher value.
- On any operating system with an installed Java Runtime Environment (JRE) you can also directly run yEd from the command line and set the heap space limit as follows.
- Open a command prompt.
- Go to the directory where yEd is installed.
- Type java -Xmx768m -jar yed.jar and hit the return key.
Specifying too much heap space may prevent yEd from starting. In this case an error message "The JVM could not be started. The main method may have thrown an exception." may be shown.