<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div>Hello there!</div>
<div>&nbsp;</div>
<div>We have been using IcedTea/PulseAudio for some load tests for playing audio and came across a memory leak which we are now searching.</div>
<div>Test setup: Create a Clip object of some arbitrary sound file, play it once, then close it – rinse and repeat, many times.</div>
<div>&nbsp;</div>
<div>After a few hours we came across an out of memory exception. Analysing the memory dump we found that all Clip objects were still active, with the garbage collector root being &quot;JNI Global&quot; for the stream objects that each Clip is creating. See attached
image showing a selected Clip object. The clip itself was kept alive through callback interfaces to Stream, but isOpen=false proves that close() was called.</div>
<div>&nbsp;</div>
<div>I then proceeded to go through the code of icedtea6-1.9.13 and came across the Stream.java / org_classpath_icedtea_pulseaudio_Stream.c pair.</div>
<div>The native function for native_pa_stream_new() does the call to NewGlobalRef() to keep the Stream object alive – presumably for the callbacks. But I didn't find the complementary call to DeleteGlobalRef().</div>
<div>I'd assume this should be done in native_pa_stream_unref(), as this one is the last to be called from PulseAudioDataLine.close() -&gt; Stream.free() .</div>
<div>&nbsp;</div>
<div>How is the stream expected to be released properly? Are we missing something or is this leak genuine?</div>
<div>For now we will modify our code to keep and reuse the Clip objects, but it would be good to know the root cause.</div>
<div>&nbsp;</div>
<div>Thanks and kind regards,</div>
<div>ch</div>
<div><font face="Tahoma" size="1" color="dimgray"><span style="font-size:7.5pt;">____________________________________________________<br>

<font size="2"><span style="font-size:10pt;"><b>Christian Haas<br>

</b></span></font>Software Engineer<br>

<font size="2" color="#003399"><span style="font-size:10pt;">FREQUENTIS&nbsp;AG<br>

<br>

</span></font>Innovationsstraße 1,&nbsp;1100 Vienna,&nbsp;Austria<br>

Phone&nbsp;&nbsp; &#43;43-1-811 50 –&nbsp;8353<br>

Mobile &nbsp;&nbsp;&#43;43-664-60 850&nbsp;– 8353<br>

Fax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#43;43-1-811 50 – 77 8353<br>

Web<font face="Calibri" color="darkgray">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="darkgray"> </font><a href="www.frequentis.com"><font color="blue"><u>www.frequentis.com</u></font></a><br>

E-Mail&nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:christian.haas@frequentis.com"><font color="blue"><u>christian.haas@frequentis.com</u></font></a></span></font></div>
<div><font size="3"><span style="font-size:12pt;">&nbsp;</span></font></div>
<div><font face="Tahoma" size="1" color="dimgray"><span style="font-size:7.5pt;">Handelsgericht Wien (Vienna Commercial Court): FN 72115 b</span></font></div>
<div><font face="Tahoma" size="1" color="dimgray"><span style="font-size:7.5pt;">DVR 0364797, ATU 14715600</span></font></div>
<div><font face="Tahoma" size="1" color="dimgray"><span style="font-size:7.5pt;">____________________________________________________<br>

Diese&nbsp;E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese&nbsp;E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese&nbsp;E-Mail. Das unerlaubte
Kopieren sowie die unbefugte Weitergabe dieser&nbsp;E-Mail sind nicht gestattet.</span></font></div>
<div><font face="Tahoma" size="1" color="dimgray"><span style="font-size:7.5pt;">This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately
and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. </span></font></div>
<div>&nbsp;</div>
<div><img src="cid:2B73117C8F9F3543966D7AD558BB2589@frequentis.com"> </div>
<div>&nbsp;</div>
</span></font>
</body>
</html>