Skip to content

faq 191627275

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

runtime and memory usage

by Stephan Lehmler on 2018-02-28 11:30:24


Hello,

while running a rather large simulation I constantly run into problems regarding runtime and memory limitations.

My system is a recent laptop (CPU i5-6200U + 16GB Ram) and I dedicated 10GB Ram for MATSim.

I am trying to run a simulation with public transport on a large network:

transit router:
#nodes: 30323 #links total: 12343882 #transfer links: 12314639

The population contains of 677070 persons with simple three-step plans of the form Origin-Destination-Origin. The agents position is given by xy-coordinates.

After starting the simulation with the aim of doing 10 iterations, I first noticed that one run takes a very long time. MATSim takes roughly 11hours until Iteration0 is finished and Iteration1 starts. Iteration1 runs for more than a whole day until the simulation stops with an 'java.lang.OutOfMemoryError: Java heap space' error. So the simulation ran out of memory in the second run. I assume this to be due to the re-planning, which makes the plan.xml more complex.

Inspecting the logfile, I noticed that the methods to done before the simulation "PersonPrepareForSim" and "PlanRouter" seem to need most of the time. The simulation itself does run for roughly 20 minutes.

At first, I thought this is mainly due to the size of my population, but as I found in the userguide0.6:

"MATSim is able to simulate scenarios with several millions agents on networks with hundreds of thousands of road segments. All you need is a current, fast desktop computer with enough memory. Even in such cases, MATSim often only takes a couple of minutes for the simulation of one complete day."

So I assume that something went wrong in my specific case.

I would be very grateful for any advice regarding my runtime and memory problems. Is a long runtime to be expected giving the size of my simulation? In that case I would be interested in how the simulations of cities like Berlin, London, Tokyo or Shanghai have been conducted. Or is there any specific error I did when setting up my inputs or my config? I am especially wondering about the large number of links in my network.

Thank you very much in advance.


Comments: 1


Re: runtime and memory usage

by Kai Nagel on 2018-02-28 12:27:07

The matsim public transit router has a tendency to generate too many transfer links, and your output confirms that this is probably the problem. Try setting maxBeelineWalkConnectionDistance to something much smaller (e.g. 10). We are aware of this problem, but it is not so easy to come up with a general rule to reduce the number of transfer links without also removing transfer links that should actually be there.

Maybe someone with more experience in pt could give further hints.

Clone this wiki locally