You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "gf2121 (via GitHub)" <gi...@apache.org> on 2023/10/07 06:58:03 UTC

[PR] DeletedTerms#clear should reset ByteBlockPool [lucene]

gf2121 opened a new pull request, #12630:
URL: https://github.com/apache/lucene/pull/12630

   ### Description
   
   This is a bug left by #12573. As we are using a common `ByteBlockPool` across all `BytesRefHash`, the map clear won't help release the memory held by `ByteBlockPool` and the pool will allocate new slices when new terms added because the offset is never reset.
   
   Sorry for the missing! 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] DeletedTerms#clear should reset ByteBlockPool [lucene]

Posted by "gf2121 (via GitHub)" <gi...@apache.org>.
gf2121 merged PR #12630:
URL: https://github.com/apache/lucene/pull/12630


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] DeletedTerms#clear should reset ByteBlockPool [lucene]

Posted by "gf2121 (via GitHub)" <gi...@apache.org>.
gf2121 commented on code in PR #12630:
URL: https://github.com/apache/lucene/pull/12630#discussion_r1350277816


##########
lucene/core/src/test/org/apache/lucene/index/TestBufferedUpdates.java:
##########
@@ -61,10 +61,10 @@ public void testRamBytesUsed() {
   public void testDeletedTerms() {
     int iters = atLeast(10);
     String[] fields = new String[] {"a", "b", "c"};
+    BufferedUpdates.DeletedTerms actual = new BufferedUpdates.DeletedTerms();

Review Comment:
   Actually I'm moving this to test `#clear` runs properly, not related to the memory leak issue :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] DeletedTerms#clear should reset ByteBlockPool [lucene]

Posted by "gf2121 (via GitHub)" <gi...@apache.org>.
gf2121 commented on PR #12630:
URL: https://github.com/apache/lucene/pull/12630#issuecomment-1752936864

   > 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.
   
   Yes, the previous PR is not included in 9.8.0 release.
   
   > Out of curiosity, how did you catch it? Are you running snapshot Lucene builds in production?
   
   Not really, just come up this accidentally when reading codes :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] DeletedTerms#clear should reset ByteBlockPool [lucene]

Posted by "jpountz (via GitHub)" <gi...@apache.org>.
jpountz commented on PR #12630:
URL: https://github.com/apache/lucene/pull/12630#issuecomment-1752884136

   wow good catch. Out of curiosity, how did you catch it? Are you running snapshot Lucene builds in production?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] DeletedTerms#clear should reset ByteBlockPool [lucene]

Posted by "mikemccand (via GitHub)" <gi...@apache.org>.
mikemccand commented on code in PR #12630:
URL: https://github.com/apache/lucene/pull/12630#discussion_r1350170058


##########
lucene/core/src/test/org/apache/lucene/index/TestBufferedUpdates.java:
##########
@@ -61,10 +61,10 @@ public void testRamBytesUsed() {
   public void testDeletedTerms() {
     int iters = atLeast(10);
     String[] fields = new String[] {"a", "b", "c"};
+    BufferedUpdates.DeletedTerms actual = new BufferedUpdates.DeletedTerms();

Review Comment:
   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)?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org