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启动慢?
基础教程推荐
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 降序排序:Java Map 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01