Skip to content

Fix excessive memory allocation in document scoring#68

Merged
tjgreen42 merged 1 commit intomainfrom
fix-hash-table-allocation
Dec 15, 2025
Merged

Fix excessive memory allocation in document scoring#68
tjgreen42 merged 1 commit intomainfrom
fix-hash-table-allocation

Conversation

@tjgreen42
Copy link
Copy Markdown
Collaborator

@tjgreen42 tjgreen42 commented Dec 15, 2025

Summary

  • Size the document scores hash table based on max_results rather than total_docs
  • For large corpora (10M+ documents), the previous approach tried to allocate >1GB upfront, exceeding MaxAllocSize
  • The hash table grows dynamically, so a smaller initial size works fine

Fixes #67

Size the document scores hash table based on max_results rather than
total_docs. For large corpora (50M+ documents), the previous approach
tried to allocate ~1.8GB upfront, exceeding MaxAllocSize.

The hash table grows dynamically, so a smaller initial size works fine.

Fixes #67
@tjgreen42 tjgreen42 merged commit 57b8cb0 into main Dec 15, 2025
13 checks passed
@tjgreen42 tjgreen42 deleted the fix-hash-table-allocation branch December 15, 2025 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ERROR: invalid memory alloc request size 1874788361

1 participant