Skip to Content
Java性能优化实践:JVM调优策略、工具与技巧
book

Java性能优化实践:JVM调优策略、工具与技巧

by Benjamin J. Evans, James Gough, Chris Newland
January 2021
Intermediate to advanced
342 pages
9h 1m
Chinese
Posts & Telecom Press
Content preview from Java性能优化实践:JVM调优策略、工具与技巧
JVM
上的代码执行
165
临时值在
EvaluationStack
上进行计算,它是
execMethod()
中的一个局部变量。算术操作
码也在这个栈上进行计算,执行整型的数学计算。
在这个最简单的
Ocelot
版本中没有实现方法调用,但是如果实现了,那么它将继续在常量
池中查找某个方法,以找到与要调用的方法相对应的字节码,然后递归调用
execMethod()
Ocelot 0.2
演示了这种调用静态方法的情况。
9.1.3
 
HotSpot
特定细节
HotSpot
是一款生产级
JVM
,不仅完全实现了各项功能,而且拥有大量的、为支持快速执
行而设计的高级特性,从而使得即使在解释模式下也有不错的速度。和我们在
Ocelot
这个
用作训练的示例中采用的简单风格不同,
HotSpot
是一款
模板解释器
template interpreter
),
它会在每次启动时动态构建解释器。
这理解起来要复杂得多,而且对于新手来说,阅读解释器的源代码也是一个挑战。
HotSpot
还使用了大量的汇编语言来实现简单的虚拟机操作(如算术运算),并利用原生平台的栈
帧布局以进一步提高性能。
同样可能令人惊讶的是,
HotSpot
定义并使用了没有出现在虚拟机规范中的、
JVM
特有的
(也可以说是私有的)字节码。
HotSpot
使用这些字节码来区分常用的热点情况和某个特定
操作码更一般的使用情况。
这是为了帮助处理数量惊人的边缘情况而设计的。比如,
final
方法不能被覆盖,所以开
发人员可能会认为,当调用该方法时,
javac
会生成一个
invokespecial ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

成為卓越程式設計師的38項必修法則

成為卓越程式設計師的38項必修法則

Pete Goodliffe
Java持续交付

Java持续交付

Daniel Bryant, Abraham Marín-Pérez
软件开发实践:项目驱动式的Java开发指南

软件开发实践:项目驱动式的Java开发指南

Raoul-Gabriel Urma, Richard Warburton
RxJava反应式编程

RxJava反应式编程

Tomasz Nurkiewicz, Ben Christensen

Publisher Resources

ISBN: 9787115552334