[OSM-dev] Memory-Leak in osmium

Peter Körner osm-lists at mazdermind.de
Mon Nov 21 14:58:14 GMT 2011


Am 21.11.2011 15:36, schrieb Jochen Topf:
> I don't think that there is a memory leak. Valgrind tells me that all is ok.
A program can leak memory without valgrind showing it. I already guessed 
that this data is not completely useless.

> The behaviour you see comes from the PBF reader and especially the Google
> Protobuf stuff. Protobuf does not free memory but keeps it around until the
> next time it is needed. So every time you hit a PBF block with "more" data in
> it than all the other blocks before (for instance more nodes per way), PBF will
> allocated more memory and not de-allocate it. So for a while you'll see the
> process slowly using more and more memory until it hits the peak.

260 MB for a city-sized file (mainz) and 500 MB for a country (germany) 
is a lot. That explains, why my memory calculations always were wrong.

Thanks for that explanation.

Peter



More information about the dev mailing list