Skip to content

SOLR-18202 Reduce Memory Usage of testSequentialVsParallelFingerprint#4310

Open
kotman12 wants to merge 1 commit intoapache:mainfrom
kotman12:SOLR-18202-index-fingerprint-oomes
Open

SOLR-18202 Reduce Memory Usage of testSequentialVsParallelFingerprint#4310
kotman12 wants to merge 1 commit intoapache:mainfrom
kotman12:SOLR-18202-index-fingerprint-oomes

Conversation

@kotman12
Copy link
Copy Markdown
Contributor

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

Description

testSequentialVsParallelFingerprint creates a bunch of segments by design. This creates enormous memory overhead, partly because a new searcher is opened with each commit.

Solution

I tried setting openSearcher to false but the RealtimeGetHandler searcher still gets opened and incurs similar memory overhead per commit. I landed on just writing via IW which seems ok for this test? For reference by doing this we reduce the total memory consumption of this test by about 10-20X according to my profiler.

Comment on lines +51 to +52
IndexWriter writer = iwRef.get();
for (int i = 0; i < numDocs; i++) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
IndexWriter writer = iwRef.get();
for (int i = 0; i < numDocs; i++) {
IndexWriter writer = iwRef.get();
writer.getConfig().setMergePolicy(NoMergePolicy.INSTANCE);;
for (int i = 0; i < numDocs; i++) {

Should we add this NoMergePolicy? I know we used solrconfig-nomergepolicyfactory.xml for config but does this bypass that? I trust you that this probably still creates the segments without it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It respects it since we are still getting the IW from the core:

image

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.

2 participants