Prevent memory leaks by cleaning up playlist listeners#218
Merged
Conversation
Borewit
force-pushed
the
cleanup-listeners
branch
from
October 7, 2023 17:40
7903e94 to
6d75ad7
Compare
|
👉🏻 Should I be testing this build? Additional information pertaining to the memory usage of this particular build: |
|
About the aforesaid post: I cannot remember that the excessive CPU-usage was ever an issue before — even on the ancient PC. The available CPU-processing power and physical memory coped rather well with the job at hand. Can you think of anything that could've changed that state of affairs? More importantly, do you think it can be fixed, or improved upon? |
Owner
Author
Yes that is useful, if it does not break anything it good to go.
That has been introduced in #203, when we enabled parallel processing. It uses nearly uses all CPU power available to get the job done, which should not be an issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Ths PR improves the de-registration of playlist listeners, to prevent memory leaks.
Although at various places the life-cycle management of playlist listeners improves, as well duplicate playlists lists has been removed, playlists are still being present in memory after closure of the playlist. It looks like at least a Future of the SwingWorker, which loads the playlist in the background keeps a reference to the playlist, preventing the garbage collector from cleaning it. I could not find a method to clear the Future or the SwingWorker. As the number of SwingWorker are limited as they are rotated from a pool, I assume the leak is limited.
May have resolved #219