4 Replies Latest reply on Aug 30, 2012 5:25 AM by taras.tielkes

    Lock contention on SimpleAttachable.getAttachment

    taras.tielkes

      Hi,

       

      I'm profiling our application on JBoss AS 7.1.1 standalone.

       

      I see that a significant amount of time (~7%) is spent in the following call tree:

      --------------

      java.lang.Thread.run()

      ->org.apache.tomcat.util.net.JIoEndpoint$Worker.run()

      -->org.jboss.as.web.security.SecurityContextAssociationValve.invoke(Request, Response)

      --------------

       

      There seems to be significant lock contention on the SimpleAttachable instance(s) getting invoked.

       

      In the profiler thread stack samples, there are often many threads blocking for the same lock, with a stack like the following:

      --------------

      http--0.0.0.0-8080-449 [BLOCKED]

      org.jboss.as.server.deployment.SimpleAttachable.getAttachment(AttachmentKey)

      org.jboss.as.web.security.SecurityContextAssociationValve.invoke(Request, Response)

      org.apache.tomcat.util.net.JIoEndpoint$Worker.run()

      java.lang.Thread.run()

      --------------

       

      What exactly is this "SimpleAttachable", and why does there seem to be so much CPU time wasted waiting on its locks?

       

      Thanks,

      Taras