Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
JVM的功能是什么?我所知道的是:
加载 Java 应用程序时它会执行哪些步骤?
我想知道,因为如果我将 Java 应用程序的加载时间与这些步骤进行比较:
InitializeNativeTarget
在我看来,加载 JVM 所需的时间比执行我上面列出的步骤所需的时间要长得多。那么除此之外它还有什么作用呢?
这实际上是一个非常有趣的问题 - 自己看看,运行一个 Hello World 程序,为 java 可执行文件提供选项 -XX:-TraceClassLoading。
它从头开始引导整个 JVM。这需要一段时间。