On Fri, 7 Feb 2025 23:00:37 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

>> ## Root Cause
>> Animation gets started in a background thread, which causes the animation 
>> handler to run in the FX application thread, thus creating simultaneous 
>> access to the control's fields (list of children in this case).
>> 
>> ## Solution
>> Postpone the animation unless running in the FX application thread.  There 
>> is no functional difference if the component is created/used in the FX 
>> application thread.
>
> Andy Goryachev has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   gc

With the explicit call to `System.gc()` this now passes for me. I was also able 
to reproduce the failure without your fix using the latest version of the test, 
and confirm that it passes with your fix.

I think the frequency of calling `System.gc()` is probably too high. Perhaps 
calling it every 10 or 100 times through the loop would suffice (and then it 
would be a better stress test of object allocation, since System.gc() 
effectively introduces delay)? That might be difficult to do without modifying 
the `test` method, so we could consider this for a follow-up.

Somewhat related, I'm convinced that there is a leak somewhere. If I run just 
the pagination test for 100 seconds rather than 5, it's easy to see that the 
memory keeps growing -- with or without the fix for this bug. We should file a 
follow-up bug for this.

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

Marked as reviewed by kcr (Lead).

PR Review: https://git.openjdk.org/jfx/pull/1698#pullrequestreview-2606530903

Reply via email to