Frequently Asked Questions


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

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

On the command line, you need to add -mx1000m:

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".
  • Click Apply or Run.
What are the System Requirements for MATSim?

MATSim requires at least Java 1.6.

To run large simulations, you'll need a high-end machine with enough RAM and disk space. The provided examples are smaller ones and should run on all machines where Java 1.6 is running.

More details can be found at the System Requirements page for MATSim.

Where is the log-file located?

If you run a simulation with the standard MATSim Controler, a log-file should be created inside the output directory of your simulation.

What is my "root" directory from where all pathnames ("./xxx...") are defined?

 If you call "java -cp .../matsim.jar ...", it is the directory where you execute this command.

In Eclipse, it is normally the root of the project. So if you have a project called MATSim, and a directory "inputs" inside this, you need to say "./inputs/...".

I get X11 related Exceptions when running on a server. What's wrong?

Java may try to access some X11 features when creating image buffers for graphs. If your server doesn't have X11 installed, this leads to Exceptions like

Exception in thread "main" java.lang.NoClassDefFoundError:
Could not initialize class sun.awt.X11GraphicsEnvironment

Try starting MATSim with the Java option -Djava.awt.headless=true set, i.e.:

java -Djava.awt.headless=true -cp MATSim.jar org.matsim.run.Controler config.xml
I want to work off-line. Is that possible?

Yes, this is possible. MATSim includes a copy of the required DTD and XSD files, where it will look for in case you are not on-line.

If you experience problem working off-line, try the following steps:

  • Make sure your computer is indeed off-line. Sometimes (e.g. in public places), your computer is connected to some WiFi network, but you're not authorized to use it. In such cases, MATSim just sees the available internet connection and tries to download the DTD/XSD files for verification. This will fail, after a rather long time out typically. In such a case, switch off your network interface completely.
  • in the top-level directory where MATSim runs, create a directoy "dtd" and copy the missing DTD/XSD files into this directory.
  • If all else fails, change the "SYSTEM" path in your XML files to a local path (filename), not a http path.

 

I want to print the whole manual rather than having to click through it on the screen.

Most pages feature, near the bottom, a button "printer-friendly version", which does not only print the page itself, but also all pages "underneath" it in the hierarchy.