Is it possible to measure cache misses in a running JVM?
Even better, is there a way to get these metrics in JProfiler? Or any other profiler?
I have explored JProfiler options and haven't seen an inspection for this.
You can also calculate a miss ratio by dividing the number of misses with the total number of content requests. For example, if you look over a period of time and find that the misses your cache experienced was11, and the total number of content requests was 48, you would divide 11 by 48 to get a miss ratio of 0.229.
What Is a Cache Miss? A cache miss is an event in which a system or application makes a request to retrieve data from a cache, but that specific data is not currently in cache memory. Contrast this to a cache hit, in which the requested data is successfully retrieved from the cache.
On linux you can use perf-map-agent which provides java integration for perf-tools.
async-profiler is another tool supporting perf events.
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