Troubleshooting “Out of Memory” Error Upon InstallAnywhere Launch or Command Line Build
InstallAnywhere 2023 R1
Launching the InstallAnywhere Advanced Designer will sometimes lead to an error condition called OutOfMemory, which causes the user interface to freeze, and you are unable to proceed further in loading or building a project. This error could also occur when building a project via command line using the build.exe or build-as-invoker.exe commands
This error occurs when the repository of all kinds of objects in Java, which is called heap space, is running low on memory. It could also be caused by a failure to initialize the Java VM because not enough memory was acquired for the object heap. In order to have better performance and avoid such errors, it is advisable to set the initial and maximum JVM heap size for the InstallAnywhere Advanced Designer and for the build command line.
• | Setting Initial and Maximum JVM Heap Size for the Advanced Designer |
• | Setting Initial and Maximum JVM Heap Size for Building via Command Line |
Setting Initial and Maximum JVM Heap Size for the Advanced Designer
To set the initial and maximum JVM heap size for the advanced designer, perform the following steps.
To set the initial and maximum JVM heap size for the Advanced Designer:
1. | Locate the InstallAnywhere.lax file in the InstallAnywhere installation directory. |
2. | Open the file in a text editor and search for the following section: |
# LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.INITIAL
# -----------------------------------------
# the initial heap size for the Java VM
lax.nl.java.option.java.heap.size.initial=25165824
# LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.MAX
# -------------------------------------
# the maximum heap size for the Java VM
lax.nl.java.option.java.heap.size.max=134217728
3. | Assign values to these properties in bytes. The example below allocates 536870912 bytes of memory to the initial and maximum heap sizes: |
lax.nl.java.option.java.heap.size.initial=536870912
lax.nl.java.option.java.heap.size.max=536870912
Ideally, you should enter values in multiples of 1024 (more than 1 mb). For more information on selecting a heap size, you may want to consult Oracle Java documentation.
Note:For the Advanced Designer, you must specify heap sizes in bytes. Attempting to specify heap sizes in a different unit of measure by appending m, k, or g will have no effect.
4. | Save the InstallAnywhere.lax file. |
5. | Close and reopen the InstallAnywhere Advanced Designer. |
Setting Initial and Maximum JVM Heap Size for Building via Command Line
To set the initial and maximum JVM heap size for the build.exe and build-as-invoker.exe commands, perform the following steps.
To set the initial and maximum JVM heap size for build commands:
1. | Locate the Build.lax file in the InstallAnywhere installation directory. |
2. | Open the file in a text editor and search for the following section: |
# LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.INITIAL
# -----------------------------------------
# the initial heap size for the Java VM
lax.nl.java.option.java.heap.size.initial=25165824
# LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.MAX
# -------------------------------------
# the maximum heap size for the Java VM
lax.nl.java.option.java.heap.size.max=134217728
3. | Assign values to these properties. |
The example below allocates 536870912 bytes of memory to the initial and maximum heap sizes:
lax.nl.java.option.java.heap.size.initial=536870912
lax.nl.java.option.java.heap.size.max=536870912
The default size for these values is measured in bytes. Append the letter k or K to the value to indicate kilobytes, m or M to indicate megabytes, and g or G to indicate gigabytes. The example below allocates 512 megabytes of memory to the initial and maximum heap sizes
lax.nl.java.option.java.heap.size.initial=512m
lax.nl.java.option.java.heap.size.max=512m
4. | Save the Build.lax file. |