[Rev 01] RFR: 8236259: MemoryLeak in ProgressIndicator

Kevin Rushforth kcr at openjdk.java.net
Fri Dec 20 13:26:16 UTC 2019


On Fri, 20 Dec 2019 09:53:56 GMT, Florian Kirmaier <fkirmaier at openjdk.org> wrote:

>> @dsgrieve 
>> It's worth mentioning that JavaFX already has many tests based on System.gc().
>> An advantage of having a testsuit as an library (or copyied from an library) is, that its stability is regulary verified by the travis builds for different JVMs.
>> The alternative would be to not test for memory-leaks at all which is much worse than having slightly unstable tests.
>> Maybe it can make sense to seperate these tests for leaks in an own testgroup.
>> 
>> I'm introducing this library in more and more projects. I never had problems with unstable tests. 
>> I only had this kind of problem when I wrote the WeakReference/System.gc/sleep-logic for every single test.
> 
> I highly doubt that a code analysis tool will find such memoryleaks.

I agree. Static analysis tools are quite limited in this regard, and are in now way a substitute for regression testing.

So the question is how best to test fixes for memory leaks at runtime. Our current approach can be best characterized as "ad hoc", and is not all that robust (although works well enough in most cases and is still much better than doing no testing at all). I would welcome discussion of a more robust approach for testing, but it should be decoupled from this bug fix, and discussed as a separate JBS Enhancement request.

-------------

PR: https://git.openjdk.java.net/jfx/pull/71


More information about the openjfx-dev mailing list