<p>Has anyone used the new Java 1.6 JDK tool, <a href="http://web.archive.org/web/20070724060100/https://visualvm.dev.java.net/" rel="nofollow noreferrer">VisualVM</a>,  to profile a production application and how does the application perform while being profiled?</p>

<p>The documentation say that it is designed for both Production and Development use, but based on previous profiling experience, with other profiling tools, I am hesitant.</p>

[{'answer_id': 76649, 'author': 'BenCourliss', 'author_id': 8907, 'author_profile': 'https://Stackoverflow.com/users/8907', 'pm_score': 3, 'selected': False, 'text': '<p>While i haven\'t personally used VisualVM, I saw this <a href="http://blog.xebia.com/loitering-objects-make-web-company-lose-money/" rel="nofollow noreferrer">blog post</a> just today that might have some useful information for you.  He talks about profiling a production app using it.</p>\n'}, {'answer_id': 153348, 'author': 'Tim Howland', 'author_id': 4276, 'author_profile': 'https://Stackoverflow.com/users/4276', 'pm_score': 1, 'selected': False, 'text': "<p>I tried it on a dev box and found that when I turned off profiling it would shut Tomcat down unexpectedly. I'd be very cautious about rolling this out to production- can you simulate load in a staging environment instead? It's not as good as the real thing, but it probably won't get you fired if it goes wrong...</p>\n"}, {'answer_id': 157670, 'author': 'Matt N', 'author_id': 20605, 'author_profile': 'https://Stackoverflow.com/users/20605', 'pm_score': 0, 'selected': False, 'text': '<p>It is possible to remote connect to your server from a different computer using VisualVM.  You just need to right click on the "Remote" node and say "Add Remote Host."  </p>\n\n<p>This would at least eliminate the VisualVM overhead (if there is any) from impacting performance while it is running.</p>\n\n<p>This may not eliminate all performance concerns, especially in Production environments, but it will help a little.</p>\n'}, {'answer_id': 1534120, 'author': 'Kevin Peterson', 'author_id': 88313, 'author_profile': 'https://Stackoverflow.com/users/88313', 'pm_score': 1, 'selected': False, 'text': "<p>I've used VisualVM before to profile something running locally. A big win was that I just start it up, and it can connect to the running JVM. It's easier to use than other profiling tools I've used before and didn't seem to have as much overhead.</p>\n\n<p>I think it does sampling. The overhead on a CPU intensive application didn't seem significant. I didn't measure anything (I was interested in how my app performed, not how the tool performed), but it definitely didn't have the factor of 10 slowdown I'm used to seeing from profiling.</p>\n"}, {'answer_id': 1534221, 'author': 'gibbss', 'author_id': 116621, 'author_profile': 'https://Stackoverflow.com/users/116621', 'pm_score': 0, 'selected': False, 'text': "<p>I've used the Net Beans profiler which uses the same underpinnings as Visual VM.</p>\n\n<p>I was working with an older version of Weblogic, which meant using the 1.5 JVM, so I couldn't do a dynamic attach. The application I was profiling had several thousand classes and my workstation was pretty much unusable while the profiler instrumented them all. Once instrumentation was complete, the system was sluggish but not completely unusable. The amount of slowdown really depends on what you need to capture. The basic CPU metrics are pretty light weight. Profiling memory allocation slows things down a lot.</p>\n\n<p>I would not use it on a production system. Aside from the potential for slowdown, I eventually ran out of PermGen space because the profiler reinstruments and reloads classes when you change settings. (This may be fixed in the 1.6 agent, I don't know)</p>\n"}, {'answer_id': 1540341, 'author': 'hennings', 'author_id': 77418, 'author_profile': 'https://Stackoverflow.com/users/77418', 'pm_score': 1, 'selected': False, 'text': '<p>For just monitoring your application, running VisualVM remotely should not slow it down much. If the system is not on the edge of collapsing, I still haven\'t seen any problems. It\'s basically just reading out information from the coarse grained built-in instrumentation of the JVM. If you start profiling, however, you\'ll have the same issues as with other profilers. Basically because they all work almost they same way, often using the support in the JVM.</p>\n\n<p>Many people have problems with running VisualVM remotely, due to firewall issues, but you can even run <a href="http://spjelkavik.wordpress.com/2009/08/27/running-visualvm-through-an-ssh-tunnel-with-socks/" rel="nofollow noreferrer">Visual VM remotely over ssh</a>, with some system properties set.</p>\n'}, {'answer_id': 4831993, 'author': 'djangofan', 'author_id': 118228, 'author_profile': 'https://Stackoverflow.com/users/118228', 'pm_score': 0, 'selected': False, 'text': "<p>I've been using VisualVM a lot since before it was included in the JDK.   It has a negligable impact on the performance of the system.   I've never noticed it cause a problem with performance on the system, but then again, our Java server had enough headroom at the time to support a little extra load.   If your server is running at a level that is completely tacked out and can't handle the VisualVM running, then I would say its more likely that you need to buy another server .  Any production server should have some memory headroom , otherwise what you have is a disaster just waiting to happen.</p>\n"}, {'answer_id': 6203377, 'author': 'Michael', 'author_id': 719068, 'author_profile': 'https://Stackoverflow.com/users/719068', 'pm_score': 0, 'selected': False, 'text': "<p>I have used VVM(VavaVoom?) quite extensively, works like a charm in the light mode, i.e. no profiling, just getting the basic data from the VM. But once you start profiling and there are many classes, then there is considerable slowdown. I wouldn't profile in a production environment even if you have 128 core board with 2 tera of memory purely because the reloading and re-defining of the classes is tricky, the server classloaders are another thing, also vary from one server implementation to another, interfering with them in production is not a very good idea.</p>\n"}]
['https://Stackoverflow.com/questions/76042', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8530/']