Let's say I have a methodA which takes X ms in execution. And let's say application GC takes Y ms. Ideally my overall method time should be bound between [X,X+Y]. But in real life we are seeing the execution time to be way more than X+Y.
What other activities in JVM can contribute to this? We have looked at safepointing time, but did not find it to be a major contributor. What are the tools using which this additional time taken can be measured?