-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8253977: More memory leaks in client-libs on macOS #514
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
Conversation
👋 Welcome back serb! A progress list of the required criteria for merging this PR into |
/label delete 2d |
@mrserb The label
|
/label remove 2d |
@mrserb |
@@ -224,7 +224,7 @@ protected void uninstallListeners(final AbstractButton b) { | |||
b.removeAncestorListener(listener); | |||
} | |||
uninstallHierListener(b); | |||
AquaUtilControlSize.addSizePropertyListener(b); | |||
AquaUtilControlSize.removeSizePropertyListener(b); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A tiny leak existed from the initial Mac OS X Port Project.
JTextField tf = ((JSpinner.DefaultEditor) editor).getTextField(); | ||
if (tf != null) { | ||
tf.removeFocusListener(getNextButtonHandler()); | ||
tf.removeFocusListener(getPreviousButtonHandler()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We started to add these listeners in JDK-8238824, but forgot to remove it.
@Override | ||
public void setBackground(final Color c) { | ||
super.setBackground(c); | ||
updateOpaque(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code was added in the JDK-8033786, when it was implemented it was possible to call this method from the Window.setBackground() and from the Window.getPeer().setBackground().
Since the Window.setBackground() is always followed by the peer.setOpaque()->updateOpaque(), and now it is not possible to use the peer directly this method became redundant.
Deleted it in this fix since it generates a bunch of memory garbage.
test(chooser.getPropertyChangeListeners()); | ||
test(chooser.getAncestorListeners()); | ||
test(chooser.getVetoableChangeListeners()); | ||
private static void checkListenersCount(Component comp) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a test improvement, now we will check the listeners recursively for each component inside FileChooser.
* @run main/timeout=300/othervm -Xmx12m -XX:+HeapDumpOnOutOfMemoryError UnninstallUIMemoryLeaks | ||
* @bug 8134947 8253977 | ||
* @library /test/lib | ||
* @run main/timeout=450/othervm UnninstallUIMemoryLeaks | ||
*/ | ||
public final class UnninstallUIMemoryLeaks { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this test stricter:
- The execution time is increased to 350 seconds per L&F.
- To minimize the overall time execution the test now forks a subtest for each L&F and run it in parallel
- Now the test recursively checks the number of listeners in all components
- The "-mx12m" option is changed to "-mx9m"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
@mrserb This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for more details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 12 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
/integrate |
@mrserb Since your change was applied there have been 29 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 3973073. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
While working on the JDK-8240709 I have found that the test created for JDK-8134947 (currently executed on macOS only) can fail due to memory leaks(more often if change it to be stricter). See my comments inline.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/514/head:pull/514
$ git checkout pull/514