-
Notifications
You must be signed in to change notification settings - Fork 1.3k
DeletedTerms#clear should reset ByteBlockPool #12630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
mikemccand
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @gf2121!
Just to confirm: the previous PR was not released/included in 9.8.0 right? So users are not hitting this memory leak when using the 9.8.0 release.
| public void testDeletedTerms() { | ||
| int iters = atLeast(10); | ||
| String[] fields = new String[] {"a", "b", "c"}; | ||
| BufferedUpdates.DeletedTerms actual = new BufferedUpdates.DeletedTerms(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does moving the BufferedUpdates up here mean the memory leak is more obvious (i.e. the test now fails with OOME or so, before your fix)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I'm moving this to test #clear runs properly, not related to the memory leak issue :)
|
wow good catch. Out of curiosity, how did you catch it? Are you running snapshot Lucene builds in production? |
Yes, the previous PR is not included in 9.8.0 release.
Not really, just come up this accidentally when reading codes :) |
Description
This is a bug left by #12573. As we are using a common
ByteBlockPoolacross allBytesRefHash, the map clear won't help release the memory held byByteBlockPooland the pool will allocate new slices when new terms added because the offset is never reset.Sorry for the missing!