You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/08/24 18:46:46 UTC

[GitHub] [lucene-solr] uschindler commented on a change in pull request #1779: LUCENE-9478: Prevent DWPTDeleteQueue from referencing itself and leaking memory

uschindler commented on a change in pull request #1779:
URL: https://github.com/apache/lucene-solr/pull/1779#discussion_r475820891



##########
File path: lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterDeleteQueue.java
##########
@@ -36,6 +37,26 @@
  */
 public class TestDocumentsWriterDeleteQueue extends LuceneTestCase {
 
+
+  public void testAdvanceReferencesOriginal() {
+    WeakAndNext weakAndNext = new WeakAndNext();
+    DocumentsWriterDeleteQueue next = weakAndNext.next;
+    assertNotNull(next);
+    System.gc();

Review comment:
       I would also use a ReferenceQueue to do the check. The weak.get() has a bad taste to me.
   I did not check that System.gc() tries to cleanup weak refs, but if it does and we can rely on this, I am fine.




----------------------------------------------------------------
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.

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