<!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">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;">
    JBoss Tomcat high number of threads and slower application response
</h3>
<span style="margin-bottom: 10px;">
    reply from <a href="http://community.jboss.org/people/rohit.macherla">Rohit Macherla</a> in <i>Performance Tuning</i> - <a href="http://community.jboss.org/message/536267#536267">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>I was analysing the thread dump and found this :</p><p>Most of the threads that are BLOCKED are hung from stacktrace originating from :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">.
.
javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
javax.xml.bind.ContextFinder.find(ContextFinder.java:372)
javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
org.jboss.ws.core.jaxws.CustomizableJAXBContextFactory.createContext(CustomizableJAXBContextFactory.java:92)
.
.
</code></pre><p><br/>These threads are either executing the actual web-service method or are trying to perform a getPort() operation.</p><p>My Java code for invoking the webservice is of the type :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java"><font color="navy"><b>public</b></font> SomeResponse invoke(Payload payload)
<font color="navy">{</font>
&#160; SOcreation.ServiceManagementAPIService SO_service = <font color="navy"><b>new</b></font> SOcreation.ServiceManagementAPIService();
&#160; SOcreation.ServiceManagementAPI SO_port = SO_service.getServiceManagementAPIPort();
&#160; SO_port.callWebService(payload); <font color="darkgreen">//Sample</font>
<font color="navy">}</font>
</code></pre><p>Is this a good practice ? Or should the service and port objects be created as Class-level (making them global and/or static too) ?</p><p>Is there any way to escape the getPort() thing ? Why does the WSDL be read out each and every time the WebService is called ? Doesn't JBoss cache it ? In the "debug" log mode, I find that the entire WSDL is printed out (i.e., read from the file) and then parsed (XML parsing is costly).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>(The synchornized Map method which I was discussing also arises out of the creation of JAXB context)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Any answers ?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Cheers</p><p>Rohit M</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/536267#536267">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>