Skip to content

Conversation

@jshook
Copy link
Contributor

@jshook jshook commented Oct 22, 2025

This is a utility that we can use to get an empirical estimation of how much heap a given index or indexing process will take. It is a part of a larger strategy for managing heap usage safely.

Why? Here are the key reasons:

  • We can take an index config and model "what if" heap usage very accurately, to understand how many vectors can reasonably fit on a system ahead of time.
  • It is meant to provide advisory limits which we can use as a reliability gate without locking in bad administrative limits which do not size appropriately when things change
  • This is a piece of a bigger idea to robustify heap usage.
  • You do this once per index and you have a cost model for it without further tracking, counting work.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 22, 2025

Before you submit for review:

  • Does your PR follow guidelines from CONTRIBUTIONS.md?
  • Did you summarize what this PR does clearly and concisely?
  • Did you include performance data for changes which may be performance impacting?
  • Did you include useful docs for any user-facing changes or features?
  • Did you include useful javadocs for developer oriented changes, explaining new concepts or key changes?
  • Did you trigger and review regression testing results against the base branch via Run Bench Main?
  • Did you adhere to the code formatting guidelines (TBD)
  • Did you group your changes for easy review, providing meaningful descriptions for each commit?
  • Did you ensure that all files contain the correct copyright header?

If you did not complete any of these, then please explain below.

return new IndexConfig(
dimension,
16,
1.5f,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: We generally default to 1.2 for overflowRatio

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noted, I'll follow this PR up with an improved one.

Copy link
Contributor

@MarkWolters MarkWolters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds some useful functionality

@jshook jshook marked this pull request as draft October 28, 2025 21:21
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.

3 participants