Skip to content

Java run configurations resolving heap size errors

Bastiaan edited this page Jan 24, 2023 · 4 revisions

Resolving heap size errors

Some simulations may have memory requirements exceeding the Java Virtual Machine (JVM) defaults. An error of the JVM concerning heap space is an indication of this. This problem can be resolved by increasing the maximum heap space available to the JVM adding additional flags when running simulations:

java -jar -Xms4096M -Xmx6144M iDynoMiCS.jar

Here -Xms4096M indicates the initial heap size and -Xmx6144M the maximum heap size available to the JVM. Obviously this value can be further increased as long as the local machine has sufficient memory available. Additionally make sure to use the 64bit version of JVM running in 64bit modus -d64, as the 32bit JVM is limited to a maximum of 4GB.

For improved performance (optimal for multi-core machines with larger memory) the Garbage first garbage collector may be used by adding the -XX:+UseG1GC flag

-XX:+UseG1GC

Memory requirements depend on the complexity of the model, for a simple model reserve roughly 8kB per agent.

Clone this wiki locally