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

Dawid Weiss edited comment on LUCENE-4252 at 7/31/12 7:48 AM:
--------------------------------------------------------------

This is useful in general. I've added this to randomized testing package, 
modifying Robert's code slightly to:

- exclude static final fields (typically constants that cannot be erased),
- exclude fields of primitive types,
- account for superclasses of the suite class (optional but turned on by 
default),
- include sorted RAM usage info for accounted fields in the assertion thrown.

Exclusion rules are customizable via rule subclassing (accept(Field) method).
                
      was (Author: dweiss):
    This is useful in general. I've added this to randomized testing package, 
modifying Robert's code slightly to:

- exclude static final fields (typically constants that cannot be erased);
- exclude fields of primitive types
- include sorted RAM usage info for accounted fields in the assertion thrown.

Exclusion rules are customizable via rule subclassing (accept(Field) method).
                  
> Detect/Fail tests when they leak RAM in static fields
> -----------------------------------------------------
>
>                 Key: LUCENE-4252
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4252
>             Project: Lucene - Core
>          Issue Type: Test
>          Components: general/test
>            Reporter: Robert Muir
>            Assignee: Dawid Weiss
>         Attachments: LUCENE-4252.patch, LUCENE-4252.patch, sfi.patch
>
>
> We run our junit tests without firing up a JVM each time.
> But some tests initialize lots of stuff in @BeforeClass and don't properly 
> null it out in an @AfterClass, which can cause a subsequent test in the same 
> JVM to OOM, which is difficult to debug.
> Inspiration for this was me committing Mike's cool TestPostingsFormat, which 
> forgot to do this: then we were seeing OOMs in several jenkins runs.
> We should try to detect these leaks in LuceneTestCase with RAMUsageEstimator 
> and fail the test.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to