Skip to content

faq 34045955

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

How can I fix "java.lang.OutOfMemoryError: Java heap space" errors?

by Kai Nagel on 2015-08-27 11:10:28


Comments: 1


Re: How can I fix "java.lang.OutOfMemoryError: Java heap space" errors?

by Kai Nagel on 2015-08-27 11:10:43

The default Java virtual machine does not provide enough memory to run large-scale projects.

On the command line, you need to add -mx1000m: [[isn't this -Xmx1000m nowadays? kai, jun'15]]

java ... -mx1000m ...
 

This basically means that Java should use 1000MB (or about 1GB) of RAM to run. Depending on your scenario, you might run MATSim with less or may need more memory.

To add this argument when running MATSim from withIn Eclipse, do the following steps:

  • In Eclipse, select the menu Run > Run Configurations...
  • In the list of run configurations on the left side, choose Java Application - MyControler (or whatever your application is named).
  • Select the Arguments tab.
  • In the text field labeled VM arguments, type "-mx1000m" [[isn't this -Xmx1000m nowadays? kai, jun'15]] .
  • Click Apply or Run.
Clone this wiki locally