<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Memory leak on org.jboss.classloader.spi.base.BaseClassLoader
</h3>
<span style="margin-bottom: 10px;">
    reply from <a href="http://community.jboss.org/people/ryanhos">Ryan Hochstetler</a> in <i>Performance Tuning</i> - <a href="http://community.jboss.org/message/555500#555500">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>This is the class blacklist.&#160; I researched this back when we were on JBoss 4.2.3 and now I'm revisiting it for JBoss 5.1.0, since things seem to have changed.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Hibernate calls class.forName() on every token in each unique query.&#160; This is one of many reasons why it's crucially important to use bind parameters in your queries.&#160; If you are using bind params, your query is parsed by Hibernate once, then placed in some parsed query cache.&#160; This parsing is what calls Class.forName() on each token in the query.&#160; If you're not using bind params, each query looks unique, and it gets reparsed each time the aruments in the WHERE clause change.&#160; The endless stream of unique arguments in the where clause (from your 100k SOAP requests) end up as parameters to Class.forName().&#160; JBoss's classloader caches failed class lookups, as a performance enhancement.&#160; In JBoss 4.2.3, this was done in RepositoryClassLoader.&#160; It was possible to set two properties which would not stop the accumulation in the class blacklist, but would stop the OutOfMemoryErrors from occurring by allowing the JVM to cull the blacklist when memory gets tight.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>-Dorg.jboss.mx.loading.blacklistMode=SoftSet</p><p>-XX:SoftRefLRUPolicyMSPerMB=500</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>However, in JBoss 5.1.0, (probably 5.x on), RepositoryClassLoader appears to be unused (zero instances in my heap dump today).&#160; The class blacklist is now contained in BaseClassLoader, which does not have the same runaway allocation guard, as far as I can tell.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>You might try filing a JIRA since this seems like a regression, but Adrian Brock has already weighed-in on the topic once before, and he's of the opinion that it's the framework's problem, not JBoss'.&#160; "There are many "stupid" webapp frameworks (and other code) around that try to continually load non-existant classes."&#160; </span><a class="jive-link-external-small" href="https://jira.jboss.org/browse/JBAS-3041" target="_blank">https://jira.jboss.org/browse/JBAS-3041</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In short, make sure that each and every one of your queries uses bind params, for this reason and numerous others all related to increased performance and security.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/555500#555500">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Performance Tuning at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2078">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>