VisualVM has two separate tabs for sampling and profiling. What is the difference between sampling and profiling in VisualVM?
VisualVM has two separate tabs for sampling and profiling. What is the difference between
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Samplingmeans taking lots of thread dumps and analyzing stack traces.This is usually faster, does not require runtime changes in your bytecode (which may break it), but is also less accurate.
Profilingmeans instrumenting your classes and methods, so they "report" whenever they are run. This is more accurate, as it counts every invocation of instrumented method, not only those caught when the dump is done. However instrumentation means that the bytecode of your classes is changed, and this may break your program. Actually, for that reason, using profiling on large application servers (like JBoss, or WebLogic) often causes everything to die or hang.