topojson / topojson-server

Convert GeoJSON to TopoJSON.
ISC License
117 stars 32 forks source link

invalid array length Allocation failed - JavaScript heap out of memory #19

Closed hyperknot closed 4 years ago

hyperknot commented 4 years ago

I'm using geo2topo with 2-3 GB ndjson, but it results in an exception.

invalid array length Allocation failed - JavaScript heap out of memory

Using --max-old-space-size=40000 on a 64 GB server. Memory usage tops at around 13 GB.

I tried node versions 8, 10, 12, 13, same results. I tried vm.max_map_count=655300 based on this SO answer: https://stackoverflow.com/a/59923848/518169, it didn't make a difference.

Is there any way to fix this bug? (note: I'm not asking a question which could be answered on StackOverflow, I'm reporting that this script is terminating in an error even though there is plenty of available memory).

mbostock commented 4 years ago

Yes, you can probably workaround this limitation using newline-delimited JSON. But I’m afraid I’m not available to help you. Sorry!