7 Replies Latest reply on Nov 11, 2009 12:48 PM by peterj

    GC does not appear to be running

    sra78

      I am using JMeter to stress test my J2EE application that is running on JBoss. With regular usage the thread count will be at 50, with Stress test, the thread count go to 200-250. Even one day after the test, I still see the same thread count in JMX console.

      When I do listThreadCpuUtilization(), I can see that around 20 thread are using 0 CPU, around 100 of them are using 50-200 CPU cycles. I am not sure whether this is normal. Isn't GC Demon thread suppose to run and clean out these threads? If I restart JBoss, count goes back to 50. But when I run the stress test again to bring the thread count up, and wait couple of days, I still see these threads, active and taking some CPU cycles.

      Any suggestions?

      Thanks,
      Jackie.

        • 1. Re: GC does not appear to be running
          peterj

          GC has nothing whatsoever to do with the HTTP threads - those are all handle by JBoss Web.

          You never said which version of JBoss AS you are using, but the 4.2.x and 5.0 version use a JBoss Web based on Tomcat 6. If you look at the Tomcat 6 documentation you will notice that the various thread management settings (such as the unused thread timeout) are no longer documented. A perusal of the source code shows that those settings are still captured from server.xml, but the settings are never used. The end result is what you see - once HTTP threads have been allocated they seem to hang around forever.

          • 2. Re: GC does not appear to be running
            sra78

            Thanks Peter.

            I did not know that GC will not flush HTTP threads. I thought since memory is taken by threads, I simply assumed it is GC's job.

            I am using JBoss 4.2.2. I will look up Tomcat documentation and see if I can find information on how to close unused threads. I will post with details if I succeed.

            • 3. Re: GC does not appear to be running
              sra78

              Per Tomcat Mail Archives and from Tomcat documentation, http://tomcat.apache.org/tomcat-6.0-doc/config/executor.html, I used 'Executor' to remove idle threads.

              I added Executor in service.xml,

              <Executor name="appThreadpool" namePrefix="APP-http-" maxThreads="200" minSpareThreads="50" maxIdleTime="60000" />


              , and used the Executor in Connector,
              <Connector executor="appThreadpool" ...... />


              Now, after 60 seconds of running stress test, the HTTP thread count is back to 50-60.

              • 4. Re: GC does not appear to be running
                parressh

                I've tried adding the executor to the server.xml file so that the threads would come down after peak load based on this forum thread but it is not working for me. Could someone let me know what I have done wrong? Here's the relevant snippet from the server.xml file.

                Thanks

                 <Service name="jboss.web">
                 <Executor name="active-executor" namePrefix="activeThread-" maxThreads="40" minSpareThreads="10" maxIdleTime="60000" />
                
                 <!-- A HTTP/1.1 Connector on port 8080 -->
                 <Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
                 executor="active-executor" connectionTimeout="20000" redirectPort="8443"
                 maxThreads="40" />
                


                • 5. Re: GC does not appear to be running
                  peterj

                  Try taking the dash out of the name.

                  • 6. Re: GC does not appear to be running
                    parressh

                    Hi Peter, unfortunately, that didn't work. Here's what I tried:

                     <Service name="jboss.web">
                     <Executor name="TomcatExecutor" namePrefix="tomcatThread" maxThreads="40" minSpareThreads="10" maxIdleTime="60000" />
                    
                     <!-- A HTTP/1.1 Connector on port 8080 -->
                     <Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
                     executor="TomcatExecutor" connectionTimeout="20000" redirectPort="8443" />
                    


                    • 7. Re: GC does not appear to be running
                      peterj

                      I do not see anything obviously wrong with your settings. Looks like it is debugging time...