I know there is an intrinsic overhead of the JVM, and I wanted to do further research to see exactly what the overhead is from.
Using the YourKit profiler I was able to find that there are giant int[] filled with seemingly random information. My guess was that these store some performance metrics and other things that the JVM uses to optimize applications; but to my surprise all the elements are value 0
.
To get my results I used the following "do nothing" program, so that the results only include things happening on the JVM.
public final class Main {
public static void main(String[] args) throws InterruptedException {
Thread.sleep(Long.MAX_VALUE);
}
}
This is a screenshot of the profiling result, and I can upload a memory snapshot if necessary.
You can find the answer by examining the incoming links to those arrays. Just right-click a reachable array, select 'Selected Objects' and then switch to 'Incoming References'.
I found that there are tables in sun.util.calendar.ZoneInfo
, sun.util.Calendar.BaseCalendar
, java.util.Currency
etc.
It's hard to tell for sure, but most likely, those large unreachable not-zeroed arrays were used by JVM to load Java byte code from .class-files. JVM doesn't need them after compilation, so they were released but haven't collected yet.
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