title: Webapp becomes sluggish on Tomcat
body: <p>I have a web app (spring/hibernate) running on Tomcat 7.0.23. The symptom
  is that after running for few days (4 to 5 days typically) the response
  becomes very slow. The page that usually loads in 2 seconds takes anywhere
  from 30 to 50 seconds. A restart brings the response back to normal (2
  sec). I have taken thread dumps before and after. I see the thread in
  question (which is taking longer time to respond) has a lock. Here is the
  snippet.</p>
  
  <pre><code>at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200)
      at
  org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
      at
  org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
      - locked &lt;0x0000000799446298&gt; (a
  org.apache.tomcat.util.net.SocketWrapper)
      at
  java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at
  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
  </code></pre>
  
  <p>Upon looking into the code, there is a synchronized method and that
  explains the lock. But, I am wondering if the locking is slowing the things
  down  then why didn't it manifest from the fresh start and why only after
  running for few days. Wondering where to look. Any clues? Thanks in advance.</p>