FAQ: How can I fix a "Cannot load Java Virtual Machine" error (memory limit set too high)?

From MIPAV
Revision as of 19:42, 13 June 2012 by Olga Vovk (Talk | contribs)

(diff) <previousrevision> | Latest revision (diff) | <nextrevision> (diff)
Jump to: navigation, search

Sometimes MIPAV will not load if the memory limit is set too high (due to user error or another program -- like antivirus -- staying resident in memory). Usually the user will see an error saying something like "Cannot load Java Virtual Machine".

Windows/Linux

  1. Open the MIPAV LanuchAnywhere configuration file in a text editor:
    • Windows example: C:\Program Files\mipav\mipav.lax
    • Linux example: /path/to/mipav/mipav.lax
  2. Find the part of the file that resembles the below snippet (here the memory limit is ~1GB):
#   LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.INITIAL
#   -----------------------------------------
#   Java start up heap size

lax.nl.java.option.java.heap.size.initial=1000000000


#   LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.MAX
#   -------------------------------------
#   Java maximum heap size

lax.nl.java.option.java.heap.size.max=1000000000
  1. Change the number at the end of both property lines to a lower number (try 100000000 -- ~100MB to test).
  2. Restart MIPAV.
  3. Try increasing the memory limit to something more reasonable, testing to make sure that MIPAV still starts after the change.

MacOS X

  1. Open the MIPAV LanuchAnywhere configuration file in a text editor:
    • Example: /Applications/mipav/mipav.app/Contents/Info.plist
  2. Find the part of the file that resembles the below snippet (here the memory limit is ~1GB):
<key>VMOptions</key>
<array>
    <string>-Xms1000M</string>
    <string>-Xmx1000M</string>
    <string>-server</string>
</array>
  1. Change the number in the lines containing the "-Xms" and "-Xmx" VM options to a lower number (try 100M to test).
  2. Restart MIPAV.
  3. Try increasing the memory limit to something more reasonable, testing to make sure that MIPAV still starts after the change.


See also:

Next: FAQ: Understanding Memory