Why is the JVM slow to start?(为什么JVM启动慢?)
问题描述
与其他运行时(如 CPython)相比,究竟是什么让 JVM(尤其是 Sun 的实现)运行缓慢?我的印象是,这主要与加载大量库有关,无论它们是否需要,但这似乎不需要 10 年的时间来解决.
What exactly makes the JVM (in particular, Sun's implementation) slow to get running compared to other runtimes like CPython? My impression was that it mainly has to do with a boatload of libraries getting loaded whether they're needed or not, but that seems like something that shouldn't take 10 years to fix.
想一想,JVM 启动时间与 Windows 上的 CLR 相比如何?Mono 的 CLR 怎么样?
Come to think of it, how does the JVM start time compare to the CLR on Windows? How about Mono's CLR?
更新:我特别关注 Unix 中常见的链接在一起的小型实用程序的用例.Java 现在适合这种风格吗?无论 Java 产生什么启动开销,它是为每个 Java 进程加起来的,还是仅在第一个进程中真正体现出来?
UPDATE: I'm particularly concerned with the use case of small utilities chained together as is common in Unix. Is Java now suitable for this style? Whatever startup overhead Java incurs, does it add up for every Java process, or does the overhead only really manifest for the first process?
推荐答案
这是 维基百科必须要做的谈谈这个问题(附上一些参考资料).
Here is what Wikipedia has to say on the issue (with some references).
似乎大部分时间只是从磁盘加载数据(类)(即启动时间受 I/O 限制).
It appears that most of the time is taken just loading data (classes) from disk (i.e. startup time is I/O bound).
这篇关于为什么JVM启动慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为什么JVM启动慢?


基础教程推荐
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 大摇大摆的枚举 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01