7 Replies Latest reply on Jul 23, 2010 11:20 AM by Peter Johnson

    CPU usage of jboss pesists to be 400%

    sun meng Newbie

      Hi:
      After jBoss has started normally ,I forward another pages on my application ,then find no response for a long time.
      By 'top' command I find that cpu usage of java pesists to be 400% in server.

       

      [root]# top -H -p 1234
      PID USER      PR  NI  VIRT  RES   SHR S   %CPU %MEM    TIME+  COMMAND                                                                  
      19608 root      25   0 1242m 914m   9496 R    99    45.4 575:22.02     java                                                                         
      3379 root       25    0  1242m 914m  9496 R   97     45.4 586:36.32    java                                                                         
      3902 root       25   0 1242m 914m  9496 R      95     45.4 585:59.96    java                                                                         
      3901 root      25   0 1242m 914m  9496 R       91     45.4 586:28.10    java

       

      The Linux thread ID's and the Java thread dump shows me that the threads spinning out of control are:

       

      "http-0.0.0.0-8080-13" daemon prio=10 tid=0xbaebb000 nid=0x4c98 runnable [0xb0a5b000]
         java.lang.Thread.State: RUNNABLE
      at java.util.HashMap.get(HashMap.java:303)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.getEncInjectionsForClass(TomcatInjectionContainer.java:443)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.getEncInjectionsForObject(TomcatInjectionContainer.java:435)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.processInjectors(TomcatInjectionContainer.java:355)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:271)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:265)
      at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:145)
      - locked <0xe1a83600> (a org.apache.jasper.servlet.JspServletWrapper)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:543)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:480)
      at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
      at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:611)
      ...


      "http-0.0.0.0-8080-5" daemon prio=10 tid=0x085bc400 nid=0xd33 runnable [0xb7742000]
         java.lang.Thread.State: RUNNABLE
      at java.util.HashMap.get(HashMap.java:303)
      at org.jboss.injection.InjectionUtil.collapseXmlMethodInjectors(InjectionUtil.java:71)
      at org.jboss.injection.InjectionUtil.collapseXmlMethodInjectors(InjectionUtil.java:92)
      at org.jboss.web.tomcat.service.injection.TomcatInjectionUtils.processDynamicBeanAnnotations(TomcatInjectionUtils.java:59)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.processAnnotations(TomcatInjectionContainer.java:407)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.processDynamicBeanAnnotations(TomcatInjectionContainer.java:382)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:274)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:265)
      at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:145)
      ...

       


      "http-0.0.0.0-8080-10" daemon prio=10 tid=0xb9e25c00 nid=0xf3e runnable [0xb716e000]
         java.lang.Thread.State: RUNNABLE
      at java.util.HashMap.get(HashMap.java:303)
      at org.jboss.injection.InjectionUtil.collapseXmlMethodInjectors(InjectionUtil.java:71)
      at org.jboss.injection.InjectionUtil.collapseXmlMethodInjectors(InjectionUtil.java:92)
      at org.jboss.web.tomcat.service.injection.TomcatInjectionUtils.processDynamicBeanAnnotations(TomcatInjectionUtils.java:59)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.processAnnotations(TomcatInjectionContainer.java:407)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.processDynamicBeanAnnotations(TomcatInjectionContainer.java:382)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:274)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:265)
      at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:145)
      - locked <0xe1711200> (a org.apache.jasper.servlet.JspServletWrapper)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
      ...

       


      "http-0.0.0.0-8080-9" daemon prio=10 tid=0xb9e25400 nid=0xf3d runnable [0xb71bf000]
         java.lang.Thread.State: RUNNABLE
      at java.util.HashMap.get(HashMap.java:303)
      at org.jboss.injection.InjectionUtil.collapseXmlMethodInjectors(InjectionUtil.java:71)
      at org.jboss.injection.InjectionUtil.collapseXmlMethodInjectors(InjectionUtil.java:92)
      at org.jboss.web.tomcat.service.injection.TomcatInjectionUtils.processDynamicBeanAnnotations(TomcatInjectionUtils.java:59)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.processAnnotations(TomcatInjectionContainer.java:407)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.processDynamicBeanAnnotations(TomcatInjectionContainer.java:382)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:274)
      at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:265)
      at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:145)
      - locked <0xe16678b0> (a org.apache.jasper.servlet.JspServletWrapper)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
      ...

       

      They all caused by "java.util.HashMap.get(HashMap.java:303)",I noticed that both in the org.jboss.web.tomcat.service.TomcatInjectionContainer.getEncInjectionsForClass and the org.jboss.web.tomcat.service.injection.TomcatInjectionUtils , Objects of type HashMap are not threadsafe. there is a old problem : https://community.jboss.org/message/63739#63739 ,but is this time it caused by jboss?I doubt that has encountered problem but don't know the real reason.

       

      Any idea, Thanks in advance.