[ 
https://issues.apache.org/jira/browse/LUCENE-5787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14041167#comment-14041167
 ] 

Uwe Schindler commented on LUCENE-5787:
---------------------------------------

I agree with all subclasses of Reference. The main usecase of WeakRefs is in 
static fields :-) - see for example the pointers to classes for static caches.

The particular reference to the groovy class could be added a String to the 
leak checker. On the other hand, if you subclass LTC for Groovy, you can add 
the annotation to prevent the leakchecker from running. This bug does not 
affect Lucene, it is a problem of 3rd party infrastructures using our test 
framework. So the big question: What does other scripting laguages do? Scala? 
JRuby? The list is endless. Maybe add an annotation like 
{{@SuppressLeakChecks([fieldname, fieldname, fieldname])}}.

> LuceneTestCase static leak checker interferes with Groovy unit tests
> --------------------------------------------------------------------
>
>                 Key: LUCENE-5787
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5787
>             Project: Lucene - Core
>          Issue Type: Bug
>    Affects Versions: 4.7, 4.8.1
>         Environment: Maven 3.0.5
> JUnit 4.11
>            Reporter: John Gibson
>
> {{LuceneTestCase}}'s static memory leak checker can break Groovy subclasses. 
> Specifically, Groovy classes have a synthetic static member variable of type 
> {{org.codehaus.groovy.reflection.ClassInfo}}. If this variable grows too 
> large then LTC will fail the test. Because the variable is added by the 
> Groovy runtime instead of by the developer there is no way for the developer 
> to clear the field themselves.
> Also note that the static leak checker does not ignore memory held by soft or 
> weak references. These should be ignored because the memory retained by such 
> fields will be reclaimed instead of triggering OutOfMemoryErrors.
> Note that because LTC is a base class for Solr's testing support classes this 
> also affects {{SolrTestCaseJ4}} and {{AbstractSolrTestCase}}.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to