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?
HPROF is a demonstration profiler shipped with the IBM® SDK that uses the JVMTI to collect and record information about Java™ execution. You can use HPROF to work out which parts of a program are using the most memory or processor time.
HPROF is a tool for heap and CPU profiling shipped with every JDK release. It is a dynamic-link library (DLL) that interfaces with the Java Virtual Machine (JVM) using the Java Virtual Machine Tool Interface (JVM TI). The tool writes profiling information either to a file or to a socket in ASCII or binary format.
If you have a heap dump file saved on your local system, you can open the file in Java VisualVM by choosing File > Load from the main menu. Java VisualVM can open heap dumps saved in the . hprof file format. When you open a saved heap dump, the heap dump opens as a tab in the main window.
hprof files generated in log folder in BI servers. hprof files are heap dump of the memory of java-based processes. Huge hprof files most commonly indicate out of memory issues about the related processes.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With