Nathaniel Flath
Nathaniel Flath

Reputation: 16015

Java hprof question

What is the difference between using -agentlib:hprof=cpu=times vs -agentlib:hprof=cpu=sample when running a java class? I know that cpu=sample causes the jvm to sample the call stack at regular intervals, but what does cpu=times do?

Upvotes: 7

Views: 3255

Answers (1)

Bill the Lizard
Bill the Lizard

Reputation: 405745

hprof=cpu=times causes the profiler to count the number of times each method was called and measure the time spent in each method.

Read about it here (using browser's find function: cpu=times).

Upvotes: 4

Related Questions