-
Notifications
You must be signed in to change notification settings - Fork 29
Node-osmium run out of memory #79
Comments
A workaround seems to use node-osmium v. 0.4.5 (and not the latest 0.5.0 used above). After running the above example script listed above for 25+ minutes, memory usage is stably around 23%. |
Seems unlikely. Usually large memory growth is due to lots of objects being allocated in JS and the node.js/v8 garbage collector not cleaning them up in time before high memory usage occurs.
Interesting - as long as you are using the same version of node that seems to indicate a leak could have been introduced in v0.5.0. What changed in v0.5.0 was 1) upgrade of libosmium from 2.6.0 to 2.6.1 and 2) ported the codebase to https://github.com/nodejs/nan. The port to nan is a much more likely culprit for memory leaks. |
Yes, I used the same setup as before (node v.0.10.25 on an m3.medium running Ubuntu 14.04.3 LTS, trusty). The only exception was to use node-osmium v. 0.4.5 and not 0.5.0. Once I switched to 0.4.5 the memory problems disappeared (*). (*) I ran this script on the full OSM history database without memory problems. This took around 45 hours. |
I think there are two different issue here. The first, missing @matiasdahl can you check how the current version works for you? |
@matiasdahl - [email protected] is now published and ready for you to test. |
Thank you very much. I did some testing, and the new 0.5.2 version of node-osmium seems to have fixed the memory issue in 0.5.0. Using node-osmium 0.5.2 (installed via npm), I ran the short example script listed above that prints the id:s for all elements for around 40 mins using the same setup as earlier. Previously this ran out of memory after around 20 minutes. Now memory usage was rather constant and at around 25%. @joto: I redirected the output to a file and I did notice that output would stop. Thank you again, and let me know if I can provide other details. |
I have opened a new issue #85 for the remaining problem and will close this one. |
👍 @joto |
I have previously ran various node-osmium scripts that extract data from the full OpenStreetMap history. I have previously run these on an m3.medium instance on AWS with 3.75G of memory without any problems. Lately, however, these scripts run out of memory. Is it possible that some recent update has introduced a memory leak somewhere?
The instance setup is described here, and below is a simple example script that run out of memory:
By running
top
, I found that the script starts with around 25% of memory usage (out of 3.75G) and this slowly increases. After c. 20 mins, it is around 95% and a few minutes after that the process is aborted.This is with Ubuntu 14.04.3 LTS (trusty),
node
version v0.10.25, and with the following npm packages installed:Please let me know if I can provide further details.
Thank you!
The text was updated successfully, but these errors were encountered: