为什么JVM启动缓慢? [英] Why is the JVM slow to start?

查看:414
本文介绍了为什么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?

推荐答案

这是 Wikipedia必须做什么说出这个问题(有一些参考文献).

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启动缓慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆