3 Replies Latest reply: Jun 15, 2011 8:45 AM by 802316 RSS

    Where is it blocking?

    869049
      Hi All,

      I've got a thread dump after an out of memory and some threads are in BLOCKED state, but i cannot figure out why since there is no explicit "- waiting on <someaddress>"

      Please, how can that be explained?

      Thanks

      "TP-Processor96" daemon prio=10 tid=0x00007fef5409f000 nid=0x3b72 waiting for monitor entry [0x00007fef581cb000]
      java.lang.Thread.State: BLOCKED (on object monitor)
           at java.lang.reflect.Method.copy(Method.java:143)
           at java.lang.reflect.ReflectAccess.copyMethod(ReflectAccess.java:118)
           at sun.reflect.ReflectionFactory.copyMethod(ReflectionFactory.java:282)
           at java.lang.Class.copyMethods(Class.java:2748)
           at java.lang.Class.getDeclaredMethods(Class.java:1791)
           at org.apache.catalina.util.DefaultAnnotationProcessor.processAnnotations(DefaultAnnotationProcessor.java:226)
           at org.apache.jasper.runtime.AnnotationHelper.postConstruct(AnnotationHelper.java:44)
           at org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:127)
           at org.apache.jsp.tag.web.template_002dgroup.name_tag._jspx_meth_c_005fotherwise_005f0(name_tag.java:301)
           at org.apache.jsp.tag.web.template_002dgroup.name_tag._jspx_meth_c_005fchoose_005f0(name_tag.java:164)
           at org.apache.jsp.tag.web.template_002dgroup.name_tag.doTag(name_tag.java:124)
           at org.apache.jsp.tag.web.template_002dgroup.box_tag._jspx_meth_template_002dgroup_005fname_005f0(box_tag.java:147)
           at org.apache.jsp.tag.web.template_002dgroup.box_tag.doTag(box_tag.java:97)
           at org.apache.jsp.tag.web.common.path_tag._jspx_meth_template_002dgroup_005fbox_005f0(path_tag.java:1553)
           at org.apache.jsp.tag.web.common.path_tag._jspx_meth_c_005fforEach_005f4(path_tag.java:1515)
           at org.apache.jsp.tag.web.common.path_tag._jspx_meth_c_005fwhen_005f7(path_tag.java:1475)
           at org.apache.jsp.tag.web.common.path_tag._jspx_meth_c_005fchoose_005f5(path_tag.java:1435)
           at org.apache.jsp.tag.web.common.path_tag._jspx_meth_c_005fif_005f7(path_tag.java:1402)
           at org.apache.jsp.tag.web.common.path_tag._jspx_meth_c_005fif_005f6(path_tag.java:1351)
           at org.apache.jsp.tag.web.common.path_tag.access$10(path_tag.java:1333)
           at org.apache.jsp.tag.web.common.path_tag$Helper.invoke2(path_tag.java:2087)
           at org.apache.jsp.tag.web.common.path_tag$Helper.invoke(path_tag.java:2111)
           at org.apache.jsp.tag.web.section.body_tag.doTag(body_tag.java:98)
           at org.apache.jsp.tag.web.common.path_tag._jspx_meth_section_005fbody_005f0(path_tag.java:737)
           at org.apache.jsp.tag.web.common.path_tag.access$4(path_tag.java:726)
           at org.apache.jsp.tag.web.common.path_tag$Helper.invoke0(path_tag.java:2040)
           at org.apache.jsp.tag.web.common.path_tag$Helper.invoke(path_tag.java:2105)
           at org.apache.jsp.tag.web.section.section_tag.doTag(section_tag.java:98)
           at org.apache.jsp.tag.web.common.path_tag._jspx_meth_section_005fsection_005f0(path_tag.java:375)
           at org.apache.jsp.tag.web.common.path_tag._jspx_meth_c_005fif_005f2(path_tag.java:345)
           at org.apache.jsp.tag.web.common.path_tag.doTag(path_tag.java:216)
           at org.apache.jsp.template_002dgroup_jsp._jspx_meth_common_005fpath_005f0(template_002dgroup_jsp.java:388)
           at org.apache.jsp.template_002dgroup_jsp._jspx_meth_c_005fwhen_005f0(template_002dgroup_jsp.java:355)
           at org.apache.jsp.template_002dgroup_jsp._jspx_meth_c_005fchoose_005f0(template_002dgroup_jsp.java:317)
           at org.apache.jsp.template_002dgroup_jsp.access$5(template_002dgroup_jsp.java:304)
           at org.apache.jsp.template_002dgroup_jsp$Helper.invoke3(template_002dgroup_jsp.java:897)
           at org.apache.jsp.template_002dgroup_jsp$Helper.invoke(template_002dgroup_jsp.java:1034)
           at org.apache.jsp.tag.web.section.body_tag.doTag(body_tag.java:98)
           at org.apache.jsp.template_002dgroup_jsp._jspx_meth_section_005fbody_005f0(template_002dgroup_jsp.java:299)
           at org.apache.jsp.template_002dgroup_jsp.access$3(template_002dgroup_jsp.java:289)
           at org.apache.jsp.template_002dgroup_jsp$Helper.invoke1(template_002dgroup_jsp.java:872)
           at org.apache.jsp.template_002dgroup_jsp$Helper.invoke(template_002dgroup_jsp.java:1028)
           at org.apache.jsp.tag.web.section.section_tag.doTag(section_tag.java:98)
           at org.apache.jsp.template_002dgroup_jsp._jspx_meth_section_005fsection_005f0(template_002dgroup_jsp.java:250)
           at org.apache.jsp.template_002dgroup_jsp.access$0(template_002dgroup_jsp.java:240)
           at org.apache.jsp.template_002dgroup_jsp$Helper.invoke0(template_002dgroup_jsp.java:842)
           at org.apache.jsp.template_002dgroup_jsp$Helper.invoke(template_002dgroup_jsp.java:1025)
           at org.apache.jsp.tag.web.page.page_tag.doTag(page_tag.java:305)
           at org.apache.jsp.template_002dgroup_jsp._jspx_meth_page_005fpage_005f0(template_002dgroup_jsp.java:235)
           at org.apache.jsp.template_002dgroup_jsp._jspService(template_002dgroup_jsp.java:181)
           at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
           at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
           at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
           at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
           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:646)
           at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
           at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
           at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
           at org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
           at org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
           at org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
           at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
           at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
           at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
           at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
           at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
           at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
           at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
           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 com.titicaca.essm.servlets.SkinFilter.doFilter(SkinFilter.java:40)
           at com.titicaca.essm.servlets.SkinFilter.doFilter(SkinFilter.java:28)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at com.titicaca.essm.servlets.CheckLicenseFilter.doFilter(CheckLicenseFilter.java:68)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at com.titicaca.essm.servlets.SetLocaleFilter.doFilter(SetLocaleFilter.java:62)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at com.titicaca.essm.servlets.CharsetConversionFilter.doFilter(CharsetConversionFilter.java:32)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
           at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
           at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
           at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
           at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
           at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
           at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
           at java.lang.Thread.run(Thread.java:619)
        • 1. Re: Where is it blocking?
          802316
          The first entry of this method creates an object. This will block if a blocking GC is being performed.
          • 2. Re: Where is it blocking?
            869049
            Thanks for the anwser.

            The BLOCKED state in the javadoc (java.lang.Thread#State) does not mention the case a GC can indeed put a thread in BLOCKED state.
            How can GC interact with thread state? Any link to documentation?

            This explains contention patterns I'm facing where in a synchronized block the thread owning the monitor is actually calling "new Something()" and its state is BLOCKED.

            Thanks.
            • 3. Re: Where is it blocking?
              802316
              It may be an implementation detail that a monitor is used when a thread needs more memory. If its not specified, it means other JVMs might not do this. (But they still have to wait for a GC somehow)