Repository navigation
Account for the striped locks in index_gt::memory_usage - #16
Merged
Merged
Conversation
`striped_locks_gt` replaced the per-node lock bitset and allocates `ceil2(max(4 * threads * connectivity_max, 256)) * 128` bytes, which `memory_usage` did not include. With 128 threads and the default connectivity of ClickHouse (32), that is 4 MiB per index, and ClickHouse uses `memory_usage` as the weight in its vector similarity index cache. Related: ClickHouse/ClickHouse#128293 Co-Authored-By: Claude Opus 5.5 <[email protected]>
thevar1able
added a commit
to ClickHouse/ClickHouse
that referenced
this pull request
Oct 31, 2026
`striped_locks_gt`, new in `usearch` v2.26, was not included in `index_gt::memory_usage`, which the vector similarity index cache uses as the entry weight: about 4 MiB per index on a 64-core server. ClickHouse/usearch#16 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
striped_locks_gt(new in v2.26) replaced the per-node lock bitset and allocatesceil2(max(4 * threads * connectivity_max, 256)) * 128bytes, butindex_gt::memory_usagedoes not include it. With 128 threads and ClickHouse's default connectivity of 32, that is 4 MiB per index. ClickHouse usesmemory_usageas the weight of entries in the vector similarity index cache, so the cache could exceed its limit.This adds
striped_locks_gt::memory_usageand includes it inindex_gt::memory_usage. Checked with a probe: aftertry_reserve(index_limits_t(16, 128))with connectivity 16,memory_usagereports 2,121,984 bytes instead of 24,704.Related: ClickHouse/ClickHouse#128293
🤖 Generated with Claude Code