Package: openjdk-8-jre
Version: 8u242-b08-1~deb9u1
Severity: important
Dear Maintainer,
Run the following:
import java.awt.Frame;
import java.awt.event.*;
import javax.swing.*;
public class Testing extends JFrame {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
final JFrame parent = new JFrame("Parent");
JButton add = new JButton("New JFrame");
add.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
final JFrame child = new JFrame("Child");
child.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
child.setSize(300, 300);
child.setVisible(true);
}
});
parent.add(add);
parent.pack();
parent.setVisible(true);
}
});
}
}
i.e..
javac Testing.java
java Testing
<open another console window/terminal or put previous command in background>
(observe processid)
jmap histo:live processid | grep JFrame (observe the number of JFrame instances)
Exercise the JButton.
Required behaviour: JFrame instances are garbage collected.
Observed behaviour: JFrame instances are never garbage collected
(openjdk-8/debian 9)
Observed behaviour: JFrame instances are garbage collected (openjdk-11/debian
10).
-- System Information:
Debian Release: 9.12
APT prefers oldstable
APT policy: (500, 'oldstable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.9.0-12-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8),
LANGUAGE=en_AU:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages openjdk-8-jre depends on:
ii libasound2 1.1.3-5
ii libatk-wrapper-java-jni 0.33.3-13+deb9u1
ii libc6 2.24-11+deb9u4
ii libgif7 5.1.4-0.4
ii libgl1-mesa-glx [libgl1] 13.0.6-1+b2
ii libglib2.0-0 2.50.3-2+deb9u2
ii libgtk2.0-0 2.24.31-2
ii libjpeg62-turbo 1:1.5.1-2
ii libpng16-16 1.6.28-1+deb9u1
ii libpulse0 10.0-1+deb9u1
ii libx11-6 2:1.6.4-3+deb9u1
ii libxext6 2:1.3.3-1+b2
ii libxinerama1 2:1.1.3-1+b3
ii libxrandr2 2:1.5.1-1
ii openjdk-8-jre-headless 8u242-b08-1~deb9u1
ii zlib1g 1:1.2.8.dfsg-5
Versions of packages openjdk-8-jre recommends:
ii fonts-dejavu-extra 2.37-1
Versions of packages openjdk-8-jre suggests:
pn icedtea-8-plugin <none>
-- no debconf information