-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix remaining memory issues during the last 0.5% of processing planet.osm with the dense memory cache #108
Open
patrickbr
wants to merge
8
commits into
master
Choose a base branch
from
fix-memory-issues
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… nodes during computation of the geometric relations
…le-length integer, store this integer in a string, and use this string as an ID for libspatialjoin. This makes use of the fact that our IDs are always pairs of <type> and <int> and has the following benefits: (1) the ID size of a typical OSM id goes down from around 18 bytes to around 5 bytes, (2) the disk space required for the geometry cache (where these IDs are stored in) is reduced, especially for nodes (where ONLY the id is stored on disk), the memory overhead of the relation tracking (via libspatialjoins "collection of geometry refs" functionality) is greatly reduced. Note: for further optimiziations regarding the memory problem with the dense RAM cache, I am waiting for profiling results from massif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@patrickbr @lehmann-4178656ch I didn't have time for #107 yesterday anymore and will look into it today |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an unfinished draft PR to fix the remaining memory issues in the final 0.5% of phase 2 (dump) when processing
planet.osm
with the dense RAM cache.The current version attempts to further reduce the memory and disk space overhead of calculating the geospatial relations.
libspatialjoin
requires string IDs to identify geometries. Previously, the full prefixed IRI (e.g.osmnode:3454354544
) was used as an ID. With 492069c, we use the more efficient schemawhere
[type]
is a single byte identifier (1 for nodes, 2 for ways, 3 for way areas, 4 for relation area, and 5 for relations), and[integer id]
is the OSM ID encoded as a variable-length integer. These bytes are directly stored in astd::string
used as the ID forspatialjoin
.spatialjoin
never interprets these IDs, so they can contain arbitrary byte sequences. In particular, note thatlibspatialjoin
stores them asstd::string
s, not C strings, so 0 bytes are allowed and will be returned from the cache correctly (otherwise, IDs like 128 would not work).This has the following benefits:
libspatialjoin
s "collection of geometry refs" functionality) is greatly reduced.For a further reduction of the memory footprint in the final 0.5%, I am waiting for profiling results from massif.