gpt4 book ai didi

Java -server 标志和编译

转载 作者:塔克拉玛干 更新时间:2023-11-01 22:51:22 25 4
gpt4 key购买 nike

this article据称:

The JDK includes two flavors of the VM -- a client-side offering, and a VM tuned for server applications. These two solutions share the Java HotSpot runtime environment code base, but use different compilers that are suited to the distinctly unique performance characteristics of clients and servers. These differences include the compilation inlining policy and heap defaults.

The JDK contains both of the these systems in the distribution, so developers can choose which system they want by specifying -client or -server.

Although the Server and the Client VMs are similar, the Server VM has been specially tuned to maximize peak operating speed. It is intended for executing long-running server applications, which need the fastest possible operating speed more than a fast start-up time or smaller runtime memory footprint.

The Client VM compiler serves as an upgrade for both the Classic VM and the just-in-time (JIT) compilers used by previous versions of the JDK. The Client VM offers improved run time performance for applications and applets. The Java HotSpot Client VM has been specially tuned to reduce application start-up time and memory footprint, making it particularly well suited for client environments. In general, the client system is better for GUIs.

这是否意味着如果想要使用 -server 标志运行应用程序,则必须使用特定模式进行编译才能使其正常工作?

最佳答案

不,这是一个运行时设置。您的应用程序的字节码是相同的。启动 JVM 时使用此标志。

混淆可能来自于“编译”也发生在运行时的事实,因为 JVM 将 Java 字节码 JIT(即时)编译为 native 机器码(以及如何完成受这个标志)。

关于Java -server 标志和编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12313979/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com