-
Bug
-
Resolution: Fixed
-
P3
-
5.0u6
-
b03
-
x86
-
windows_xp
-
Verified
Problem: Leak of java.awt.Panel when components created from SWT event thread
Environment: Windows XP (SP2)
JDK 1.5.0_06 (also seen with 1.4.2_09)
SWT 3.1.2
Unzip the attached application (ZQJleak.zip file), and run the following command from its main directory:
java -Djava.library.path=org.eclipse.swt -classpath TableExample;org.eclipse.swt\swt.jar SimpleTableDemo
After about 15-20 iterations it will throw an OutOfMemoryError.
Profiling with JProbe indicates that the Panel object is getting pinned by a JNI global reference.
I've only been able to reproduce this problem when the components are created in an SWT event thread, but note that the AWT/Swing components themselves are not embedded in SWT. The same code does not leak if the components are created from any other thread.
Also, the leak will go away if the JTable.setDropTarget() is called with a null argument right after the table is created.
Environment: Windows XP (SP2)
JDK 1.5.0_06 (also seen with 1.4.2_09)
SWT 3.1.2
Unzip the attached application (ZQJleak.zip file), and run the following command from its main directory:
java -Djava.library.path=org.eclipse.swt -classpath TableExample;org.eclipse.swt\swt.jar SimpleTableDemo
After about 15-20 iterations it will throw an OutOfMemoryError.
Profiling with JProbe indicates that the Panel object is getting pinned by a JNI global reference.
I've only been able to reproduce this problem when the components are created in an SWT event thread, but note that the AWT/Swing components themselves are not embedded in SWT. The same code does not leak if the components are created from any other thread.
Also, the leak will go away if the JTable.setDropTarget() is called with a null argument right after the table is created.
- relates to
-
JDK-6407026 Memory leak using OleInitialize()/OleUninitialize() in SWT
-
- Closed
-