-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Memory Leaks #11
Comments
Thanks for the traces. Will have a look at why the vector of strings is leaking. |
There is a leak indeed, but that the problem is just a matter of cleaning up at the end of extraction. This bug will be fixed. Each street name is recorded exactly once and identified a (unique) id. A hash table is used to check if a streetname is already known. During the extraction, the hash table grows. Generally, the table is rather small, but may grow out of memory bounds on large data sets. Doing hash tables in external memory may not be feasible here, so I need to look for a different approach. How much RAM does your machine have? |
Proper cleanup fixes the leak. ==14119== LEAK SUMMARY: Will push the commit soon. |
Memory leak fixed, issue #11, thanks sivetic Typo fixed for loop replaced by boost's FOREACH
Pushed the changes to master. Closing this bug for now and opening a new issue to store the hash table with strings in a more efficient way. |
I've been struggling to find a memory leak in extractor that causes the process to eat up excessive amounts of memory on Windows and eventually crash. I've only run into the problem when processing a large file (I'm trying a North America extract, which is just shy of 5GB). I've spent a few hours trying to track the leak down with little success. The leak isn't specific to Windows, as I can see data lost when running extractor through valgrind (I've attached the output). I have not managed to parse the entire 5GB file when running through valgrind (last attempt was over 24 hours and running, had to kill the process), so I've used a smaller PBF file, which is only 3MB.
Note: valgrind run was done with the unmodified version (before my Windows commit) of OSRM to eliminate any issues that may have been introduced with my Windows changes. Both extractor runs were done on the same pbf file (3MB).
Relevant output from valgrind:
Three different stack traces for leaked memory allocations from Visual Studio:
The text was updated successfully, but these errors were encountered: