fix pthash memory estimate#97
Merged
Merged
Conversation
estimate_num_bytes_for_construction returned max(map_bytes, search_bytes), but the input hash vector lives across both phases. The partitioned external builder pushes the per-partition hashes (num_keys * sizeof(hash_type)) into in_memory_partitions and only adds the build estimate to its running 'bytes' counter, so the bytes < config.ram gate underestimated true residency by num_keys * sizeof(hash_type) per partition. For hash128 (16B) plus the search-phase peak (~25B/key), peak per- partition residency is ~41B/key while the gate believed ~25B/key, so config.ram=2GiB actually allowed ~3.2GB resident. Adding the input hashes outside the max makes config.ram match observed RSS.
The previous commit added the input hashes outside the max with the correct sizeof(hash_type), so the pre-existing num_keys * sizeof(uint64_t) term inside num_bytes_for_search was double-counting.
This file contains hidden or 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
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.
No description provided.