osmium icon indicating copy to clipboard operation
osmium copied to clipboard

memleak in MP-Assembling-Code

Open MaZderMind opened this issue 12 years ago • 2 comments

Hi Jochen,

I'm trying to fix a memleak in the multipolygon-code. I tried to run an application similar to osmium_toogr2 against a planet-file and it filled my 24GB of RAM in minutes while processing the 2nd pass. While trying to find the root cause I noticed, that running osmium_tooger2 against osm-files with invlid geometries will cause valgrind to report lost memory segments.

I created a simple testcase-osm-file here: https://gist.github.com/2780147.

Running valgrind osmium_tooger2 on it shows the following leak summary:

==3562== LEAK SUMMARY:
==3562==    definitely lost: 144 bytes in 3 blocks
==3562==    indirectly lost: 1,008 bytes in 20 blocks
==3562==      possibly lost: 189 bytes in 6 blocks
==3562==    still reachable: 177,643 bytes in 231 blocks
==3562==         suppressed: 0 bytes in 0 blocks

Peter

MaZderMind avatar May 24 '12 08:05 MaZderMind

Unfortunately the multipolygon code is a bit of a mess and badly in need of a refactoring.

joto avatar May 24 '12 08:05 joto

I have refactored the multipolygon code and fixed many memory leaks. Your example OSM file is now okay.

joto avatar Aug 15 '12 16:08 joto