I am profiling using the "tracing" method, with the default options (walltime=*). Our Java application is running on a Windows 10 machine, with the profiling agent attached at startup. I remotely attach the profiler from a different machine (using the YourKit Java Profiler UI) to the running Java process.
Because of the difference in time we experienced when using the application and the profiler results, I ended up putting the following code in a certain method (only there, just to try it):
- Code: Select all
System.out.println(System.currentTimeMillis());
try {
// Do the work
} finally {
System.out.println(System.currentTimeMillis());
}
For this method, the profiler will state it takes on average 201 milliseconds for 16 calls. My simple printlns indicate an average of 345 milliseconds (for exactly the same 16 calls).
I cannot figure out where this discrepancy is coming from. Any help is greatly appreciated.