The Java heap size is the system memory allocated to the creation of a JVM (Java Virtual Machine) application. If the required memory exceeds the heap size, then the application will fail to load, and an error such as "Could not create the Java virtual machine" may be thrown.
To increase the Java heap size (from the default) for Maple, please perform the following:
- Open a file manager, like Windows Explorer or File Explorer.
-
Locate the Maple launch script. It is usually found here:
Windows (32-bit Maple and OS, or 64-bit Maple and OS):
C:\Program Files\Maple 2020\bin.X86_64_WINDOWS\launch.ini
Windows (32-bit Maple and 64-bit OS):
C:\Program Files (x86)\Maple 2020\bin.win\launch.ini
Macintosh:
/Library/Frameworks/Maple.framework/Versions/2020/bin/maple
Note that the file has no extension.
Linux:$HOME/maple2020/bin/maple
Note that the file has no extension. -
Open the file with a text editor (like Notepad, TextEdit, Wordpad, or Notepad++) of your choice.
Just in case, you may want to run the program with administrative privileges.
-
On Windows locate the line:
# maxheap=700m
and remove the "#" and the space that follows it (that is, un-comment the line), and increase the value of 700. 2048 is usually a good value to try, but depending on the amount of memory you have available, a higher value can be used.
On Macintosh or Linux:Increase the "Java Heap" (the default is 512):
JAVAHEAP=1024
2048 is usually a good value to try (on Maple 2015 or newer), but depending on the amount of memory you have available, a higher value can be used.
-
Save the file and test Maple.
Please note that if your operating system won't let you save the file, you can first save the file to your Desktop folder, and then drag-and-drop it into the correct folder.
Note: The same procedure as above applies to MapleSim, but the launch file does not already have the command commented-out, so you have to add it yourself.
Windows (32-bit Maple and OS, or 64-bit Maple and OS):
C:\Program Files\Maple 2020\toolbox\MapleSim\bin.X86_64_WINDOWS\launch.ini
Windows (32-bit Maple and 64-bit OS):
C:\Program Files (x86)\Maple 2020\toolbox\MapleSim\bin.win\launch.ini
Macintosh:
/Library/Frameworks/Maple.framework/Versions/2020/toolbox/MapleSim/bin/maplesim
Linux:
$HOME/maple2020/toolbox/MapleSim/bin/maplesim