title: Performance Cost of Profiling a Web-Application in Production
body: <p>I am attempting to solve performance issues with a large and complex tomcat java web application. The biggest issue at the moment is that, from time to time, the memory usage spikes and the application becomes unresponsive. I've fixed everything I can fix with log profilers and Bayesian analysis of the log files. I'm considering running a profiler on the production tomcat server.</p>
  
  <p><strong>A Note to the Reader with Gentle Sensitivities:</strong></p>
  
  <p>I understand that some may find the very notion of profiling a production app offensive. Please be assured that I have exhausted most of the other options. The reason I am considering this is that I do not have the resources to completely duplicate our production setup on my test server, and I have been unable to cause the failures of interest on my test server.</p>
  
  <p><strong>Questions:</strong></p>
  
  <p>I am looking for answers which work either for a java web application running on tomcat, or answer this question in a language agnostic way.</p>
  
  <ul>
  <li>What are the performance costs of profiling? </li>
  <li>Any other reasons why it is a bad idea to remotely connect and profile a web application in production (strange failure modes, security issues, etc)? </li>
  <li>How much does profiling effect the memory foot print?</li>
  <li>Specifically are there java profiling tools that have very low performance costs? </li>
  <li>Any java profiling tools designed for profiling web applications?</li>
  <li>Does anyone have benchmarks on the performance costs of profiling with visualVM?</li>
  <li>What size applications and datasets can visualVM scale to?</li>
  </ul>