Skip to content

SOLR-18552: Set MMapDirectory shared arena permits to 64 - #5181

Open
nick-boss-tech wants to merge 3 commits into
apache:branch_9xfrom
nick-boss-tech:solr-18552-submit
Open

nick-boss-tech wants to merge 3 commits into
apache:branch_9xfrom
nick-boss-tech:solr-18552-submit

Conversation

@nick-boss-tech

@nick-boss-tech nick-boss-tech commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖 (posted on behalf of Nick Shanin)

https://issues.apache.org/jira/browse/SOLR-18552

What happens today

On the 9x line, Solr starts with Lucene's built-in shared arena permit limit of 1024.

  • branch_9x pins Lucene 9.12.3, whose MMapDirectory reads the system property org.apache.lucene.store.MMapDirectory.sharedArenaMaxPermits and falls back to 1024 when it is not set.
  • Neither launch script sets it: at the merge base, bin/solr initializes its script options empty, and bin/solr.cmd does the same.
  • Lucene 10 already defaults to 64, which is why the ticket scopes this change to the 9x line.

What this change does

Both launch scripts set the limit to 64 on the script options line.

  • bin/solr initializes SCRIPT_SOLR_OPTS with -Dorg.apache.lucene.store.MMapDirectory.sharedArenaMaxPermits=64; bin/solr.cmd does the same.
  • SCRIPT_SOLR_OPTS is placed before the user's SOLR_OPTS on the launch line, so an operator who sets the property themselves still overrides this default.

Proof

The property and its current default were checked against the pinned Lucene jar; verified 2026-10-18 at head cb32d0d.

  • The property string in both scripts matches the constant read by MMapDirectory.getSharedArenaMaxPermitsSysprop in lucene-core 9.12.3, and the fallback in that class is 1024, so this change moves the effective default to 64 on this line.
  • bin/solr passes a syntax check (bash -n) and the changelog entry parses.
  • There is no test run for this change: it is a launch script default, and no packaging test asserts on the script options. The verification is by construction against the jar, stated plainly.

Limits

Two limits, both about reach.

  • The Windows script change is verified by inspection and parity with bin/solr, not by execution.
  • The permit limit is consumed by Lucene's memory segment provider; where that provider is not in use, the setting has no effect.

Changelog: changelog/unreleased/SOLR-18552-mmap-arena-permits.yml

AI-generated description. Nick Shanin directed the work and takes responsibility for this contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant