Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug/Question] Heap issue #16

Open
sweco-semtne opened this issue Jul 2, 2019 · 3 comments
Open

[Bug/Question] Heap issue #16

sweco-semtne opened this issue Jul 2, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@sweco-semtne
Copy link

Hi I'm trying to run a simple example over Stockholm, Sweden and keep running into a heap space issue.

node ./src/cli.js --max-old-space-size=12192 --config car --pbf stockholm_sweden.osm.pbf --graph ../../data/sweden-latest.osrm --agents 2 --iterations 400

<--- Last few GCs --->

[72008:0x102803800]    53467 ms: Mark-sweep 1407.5 (1449.4) -> 1407.5 (1449.4) MB, 1140.7 / 0.0 ms  allocation failure GC in old space requested
[72008:0x102803800]    54866 ms: Mark-sweep 1407.5 (1449.4) -> 1407.5 (1433.4) MB, 1398.3 / 0.0 ms  last resort GC in old space requested
[72008:0x102803800]    56185 ms: Mark-sweep 1407.5 (1433.4) -> 1407.5 (1433.4) MB, 1319.1 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x2685a130427d]
Security context: 0x2dfbe80206a9 <JSObject>
    1: /* anonymous */ [<redacted>/node_modules/trip-simulator/src/simulation.js:~44] [pc=0x2685a13698ba](this=0x2dfb4fe1d251 <JSGlobal Object>,item=0x2dfbd1a9b2c1 <Object map = 0x2dfb28eefe41>)
    2: arguments adaptor frame: 3->1
    3: forEach(this=0x2dfbbd605569 <JSArray[2405817]>)
    4: /* anonymous */ [<redacted>...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [<redacted>/nodejs/10.0.0/bin/node]
 2: node::FatalTryCatch::~FatalTryCatch() [<redacted>/nodejs/10.0.0/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [<redacted>/nodejs/10.0.0/bin/node]
 4: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [<redacted>/nodejs/10.0.0/bin/node]
 5: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [<redacted>/nodejs/10.0.0/bin/node]
 6: 0x2685a130427d
 7: 0x2685a13698ba
Abort trap: 6

I've tried with node 8.5 and 10 (OSRM didn't work with 12). Do you have any suggestions on which node version to use?

Br,
Mats

@sweco-semtne
Copy link
Author

Looking at the code I guess the Map (this.nodes) in simulation.js might be growing too big?
How large of an area would you say is possible?

@morganherlocker morganherlocker added the bug Something isn't working label Jul 2, 2019
@morganherlocker
Copy link
Contributor

Hi @sweco-semtne, can you give me an estimate for file size? It should work well with a metro area. If this is a geofabrik or nextzen extract, I can also try debug directly on my machine.

@sweco-semtne
Copy link
Author

sweco-semtne commented Jul 3, 2019

Hi!

-rw-r--r--@ 1 semtne  staff  63475133  2 Jul 11:12 /<redacted>/stockholm_sweden.osm.pbf

So ~63 MB. But the road network is for the whole of Sweden right now.
But it seems it blows up already in the node "cache".

https://www.nextzen.org/metro-extracts/index.html#stockholm_sweden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants