I'm facing a problem that can easily be reproduced using the
Paint App sample application(File, New Project, Samples/NetBeans
Modules/Paint Application) . I add
byte test = new byte[1024*1024*50]; //50 megabytes
in PaintTopComponent.java just to easily see the memory leakage.
If I open and close 10 or more windows, there are still live
objects in memory even after calling garbage collector several
times. Sometimes the PaintTopComponent object is collected but its
resources not. If i keep opening and closing windows, the number
of live objects in memory increases and never get collected. I
tested using Windows 7 and Windows 10 with Netbeans 8.2, JDK 8 upd
111 and openJDK 1.8. See image for details.
PS: This problem DOESN'T happen when using Ubuntu 16.04.1 LTS with
Netbeans 8.2 and openJDK 1.8. I couldn't test using MAC OSX.