[Tile-serving] [osm2pgsql-dev/osm2pgsql] Possible improvements for new ram middle (#1466)

Jochen Topf notifications at github.com
Wed Nov 1 20:17:38 UTC 2023


The first item above (that `node_locations_t::m_data` is a `std::string` which will be resized) has an additional problem: If there isn't enough memory in a `std::string` it is typically resized by doubling the capacity. This can mean that, in the worst case, we use twice as much memory for the cache as was configured. That's not good.

To fix this we need to either implement the resizing of `m_data` ourselves, i.e. get a new `std::string` of the size we want, copy the data over and swap with `m_data`. Or we need to reserve the data in chunks. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/issues/1466#issuecomment-1789614808
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/issues/1466/1789614808 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20231101/d564a379/attachment.htm>


More information about the Tile-serving mailing list