Friedrich-Alexander-Universität
Friedrich-Alexander-Universität
Stanford Radiology

Memory Trouble

Reconstruction problems often require quite some memory, if volumetric images are processed. In this tutorial, we provide a couple of tweaks that can be performed to improve the software performance.

Increase VM Memory

Use the "-Xmx%NG" option to configure more memory for the Java VM, where %N is the number of GB that will be used at most.

The standard configuration of the 64-bit Java Virtual Machine (VM) is 2 GB. If this amount of memory is exceeded, additional memory has to be configured with a VM option. This is configured in eclipse's "Run Configurations" on the second tab "Arguments". The example on the right configures the VM using "-Xmx5G" to use at most 5 GB of memory.

Use a 64-bit Java Virual Machine

With the -version flag the java command line tool will report current version.

The 32-bit Java VM can only use up to 1.3 GB of memory. In most cases this might be insufficient. Thus, it is highly advisable to use a 64-bit VM for 3D problems. The image on the right shows the call on the command line to investigate the installed java version. The output on the right indicates Java 1.7 and 64-bit. Note that the Java byte code for 32-bit and 64-bit is the same. Only the VM restricts memory sizes.