Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Java Visual VM impacts the performance of the monitored JVM?

Tags:

java

visualvm

I'm considering to profile a production environment with Java Visual VM. I want to montitor:

  • CPU usage
  • GC activity
  • Used Heap
  • Status of threads

Does this monitoring have any significant impact to the performance of the JVM?

like image 997
Manuel Drieschmanns Avatar asked Jan 30 '23 16:01

Manuel Drieschmanns


1 Answers

In my experience there is no noticable slowdown unless you are using the profiler. With the profiler-mode, it is a matter of your filter, whether the performance-impact is notable or not. The sampler is a much safer choice, however you have to be aware, that enabling either will trigger some hot-code-replacement which renders the system unusable for a short amount of time (and may also trigger that one: JDK7 Application is getting slow after some Uptime).

Of course, if you simply want to get basic info (memory, cpu-graph, gc and thread-count) the impact will be even lower.

How certain am I with my answer? I've been using JVisualVM, JProfiler and YourKit for almost 10 years by now. We have used sampling/monitoring mode in yourkit (which does basically the same thing than jvisualVM) in production code (a regular web-app) of our customers to analyze performance bugs. It did not have any noticable impact.

However, if you only need basic system monitoring, there might be more suitable products to consider like java melody (https://github.com/javamelody/javamelody/wiki) or kieker (http://kieker-monitoring.net/).

like image 121
Jonathan Avatar answered Feb 02 '23 09:02

Jonathan