RFC: PR1050 - Stream objects not garbage collected?

Omair Majid omajid at redhat.com
Wed Jun 27 15:46:29 PDT 2012


Hi,

The attached patch is a fix for PR105. It was caused by the JVM hanging
on to global references to Stream objects. A test case is included
(causes an OutOfMemoryError without the fix). I did notice a few other
structs not being free()d and removed them (or added calls to free() them).

Okay to commit?

ChangeLog:
2012-05-27  Omair Majid  <omajid at redhat.com>

* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/Stream.java:
Add new member variable contextPointer.
* pulseaudio/src/native/org_classpath_icedtea_pulseaudio_Stream.c
(Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1new):
Save j_context as contextPointer.
(Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1unref):
Delete the global ref and dellocate the java context
(cork_callback): Don't check userdata. It is NULL.
(Java_org_classpath_icedtea_pulseaudio_Stream_native_1pa_1stream_1cork):
Dont allocate and pass a java_context to pa_stream_cork. It is not needed.
*
pulseaudio/unittests/org/classpath/icedtea/pulseaudio/PulseAudioClipTest.java
(testOpenCloseLotsOfTimes): New method.

Thanks,
Omair
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pulse-java-fix-global-ref-leak-01.patch
Type: text/x-patch
Size: 3865 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120627/351acbb2/pulse-java-fix-global-ref-leak-01.patch 


More information about the distro-pkg-dev mailing list