<span class="Apple-style-span" style><div><span class="Apple-style-span" style>Hi,</span></div><div><span class="Apple-style-span" style>We recently discovered some memory issues with XEP4.19 during load testing.</span></div>
<div><span class="Apple-style-span" style>The test comprised of multiple (about 5000 total renders) concurrent (no more than 5) FO to PDF renders of the same two page input.</span></div><div><span class="Apple-style-span" style>The input contains both tables and images.</span></div>
<div><span class="Apple-style-span" style>We found that the memory usage slowly crept up over time a heap dump revealed the following:</span></div><div><span class="Apple-style-span" style><br></span></div>71,183,440 (28.34%) [32] 5 class com/speedlegal/genericexport/XEPExport 0xdd55ba10</span><span class="Apple-style-span" style></span><span class="Apple-style-span" style> </span><div>
<span class="Apple-style-span" style>71,183,408 (28.34%) [16] 1 com/renderx/xep/FormatterImpl 0xde359840</span><span class="Apple-style-span" style></span><span class="Apple-style-span" style> </span></div><div><span class="Apple-style-span" style>71,183,392 (28.34%) [16] 1 com/renderx/xep/FormatterCore 0xdba87a10</span><span class="Apple-style-span" style></span><span class="Apple-style-span" style> </span></div>
<div><span class="Apple-style-span" style>71,183,376 (28.34%) [336] 23 com/renderx/xep/lib/Conf 0xde375fd8</span><span class="Apple-style-span" style></span><span class="Apple-style-span" style> </span></div><div><span class="Apple-style-span" style>67,949,056 (27.05%) [72] 10 com/renderx/xep/cmp/ImageFactory 0xdb32e790</span><span class="Apple-style-span" style></span><span class="Apple-style-span" style> </span></div>
<div><span class="Apple-style-span" style>65,786,552 (26.19%) [32] 1 com/renderx/util/Hashtable 0xdb32e9b8</span><div dir="ltr" align="left" style><font color="#0000ff" face="Arial"><span>65,786,520 (26.19%) [1,048,592] 91,000 array of java/lang/Object 0xe2864560<br>
</span></font><font color="#0000ff" face="Arial"><span></span></font></div><div dir="ltr" align="left" style><font color="#0000ff" face="Arial"><span><br></span></font></div><div dir="ltr" align="left" style><font color="#0000ff" face="Arial"><span>This basically means that our FormatterImpl object was holding into image references which could not be garbage collected. We were using a single FormatterImpl instance across threads to avoid the overhead of creating this object over and over. We did not and could not call the cleanup() method during this testing as we understand this cannot be called during rendering.</span></font></div>
<div dir="ltr" align="left" style><font color="#0000ff" face="Arial"><span><br></span></font></div><div dir="ltr" align="left" style><font color="#0000ff" face="Arial"><span>We made sure that TMPDIR and the appropriate MEMOIZE settings were in place but this made no difference.</span></font></div>
<div dir="ltr" align="left" style><font color="#0000ff" face="Arial"><span><br></span></font></div><div dir="ltr" align="left" style><font color="#0000ff" face="Arial"><span>Using a new instance of the FormatterImpl for each render resolved the memory issues.</span></font></div>
<div dir="ltr" align="left" style><font color="#0000ff" face="Arial"><span><br></span></font></div><div dir="ltr" align="left" style><font color="#0000ff" face="Arial"><span>Questions:</span></font></div><div dir="ltr" align="left" style>
<font color="#0000ff" face="Arial"><span>- is this a known issue, bug or limitation? </span></font></div><div dir="ltr" align="left" style><font color="#0000ff" face="Arial"><span>- is correct use of the FormatterImpl documented somewhere? The forums suggest that FormatterImpl should be used this way but cleanup should be called from time to time. Perhaps cleanup() could block if a render is in progress </span></font></div>
</div><div dir="ltr" align="left" style><font color="#0000ff" face="Arial"><span><br></span></font></div><div dir="ltr" align="left" style><font color="#0000ff" face="Arial"><span>Regards,</span></font></div><div dir="ltr" align="left" style>
<font color="#0000ff" face="Arial"><span>Justin,<span></span></span></font></div><br><br>-- <br><div><div><span style="font-family:Arial,Verdana,sans-serif;font-size:13px"><div><font face="Arial, Helvetica, sans-serif"><p align="left">
Regards,</p><p align="left"><b>Justin Lipton</b><font color="#666666"><br></font></p><p align="left"><font color="#666666"></font><span style="color:rgb(102,102,102)"></span></p><p align="left"><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"></span></span></span></p>
<div><font color="#666666"><img src="http://exari.com/Exari/media/Exari-Resources/Email%20Signature/exari-logo.png" height="34" width="96"><br></font></div><div><span style="font-family:Arial,Verdana,sans-serif;font-size:13px"><font face="Arial, Helvetica, sans-serif"><p align="left">
<font color="#666666">Email: <a href="mailto:justin.lipton@exari.com" target="_blank">justin.lipton@exari.com</a><br>Office: +613 9621 2775<br></font><span style="color:rgb(102,102,102)">Mobile: +614 0958 9943</span></p></font></span></div>
<div></div>
<div><a href="http://www.exari.com/demo-trial.html" target="_blank">Demo</a> <a href="http://blog.exari.com/" target="_blank">Blog</a> <a href="http://www.twitter.com/exari" target="_blank">Twitter</a> <a href="http://www.linkedin.com/companies/exari-systems" target="_blank">LinkedIn</a></div>
<div> </div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><font color="#666666">Boston | London | Melbourne | Munich</font><br><br></span>
<div><font color="#666666"><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(127,127,127);font-size:7pt">This
e-mail message is transmitted to you by Exari Group, Inc.. This e-mail
contains information which may be confidential and legally privileged,
and is for the exclusive use of the intended recipient. If you are not
the intended recipient, any disclosure, copying, distribution or use of
this information is prohibited. If you have received this e-mail in
error, please notify us immediately by telephone <a value="+16179383777">+1 617.938.3777</a> or by e-mail and then delete the message from your computer.</span></span></font></div><p></p></font></div></span></div></div><br>
!DSPAM:87,503bd15263731548410865!