Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bridge: replace the WeakReference in SVGAnimationEngine with a SoftReference #104

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

carlosame
Copy link
Member

In SVGAnimationEngine the animation engine is kept as a WeakReference, but with the current JVMs those references do not last very long. This may cause some animations to not happen.

Also due to that, the SwingMemoryLeakTest requires at least 4GB of heap space to pass and is triggering failures. Switching the WeakReference by a SoftReference may seem a bit radical but is the most conservative way to fix this.

As a consequence of this change, the stress-tests for WeakReference-d objects (that were failing, as explained above) are no longer executed during the build. It could be said that such tests achieved what they were intended for: check for the validity of the WeakReference approach.

Closes #103.

…ine` with a `SoftReference`

In `SVGAnimationEngine` the animation engine is kept as a `WeakReference`, but
with the current JVMs those references do not last very long. This may cause
some animations to not happen.

Also due to that, the `SwingMemoryLeakTest` requires at least 4GB of heap space
to pass and is triggering failures. Switching the `WeakReference` by a `SoftReference`
may seem a bit radical but is the most conservative way to fix this.

As a consequence of this change, the stress-tests for `WeakReference`d objects
(that were failing, as explained above) are no longer executed during the build.
It could be said that such tests achieved what they were intended for: check for
the validity of the `WeakReference` approach.

Closes #103.
@carlosame carlosame added the bug Something isn't working label Jun 26, 2024
@carlosame carlosame added this to the 1.1 milestone Jun 26, 2024
@carlosame carlosame merged commit b571a2b into master Jun 26, 2024
5 checks passed
@carlosame carlosame deleted the issue-103 branch June 26, 2024 20:01
@carlosame
Copy link
Member Author

This change was reverted today, as further experimentation did not gave good results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Java heap space error when running tests
1 participant