【实例简介】

java性能监控,想深入jvm的同学可以下载哦,良心推荐。还推荐system perfrmance不错的教程

OREILLY

Java performance The Definitive guide

Coding and testing are often considered separate areas of expertise. In this

book, author and Java expert Scott Oaks takes the approach that anyone

who works with Java should be equally adept at understanding how code

behaves in the JVM, as well as the tunings likely to help its performance

Gain in-depth knowledge of Java application performance, using the

Java Virtual Machine (vm) and the Java platform, including the language

and APl. With this comprehensive guide, developers and performance

engineers alike will learn a variety of features, tools, and processes for

mproving the way Java 7 and 8 applications perform

Apply four principles for obtaining the best results from

performance testing

a Use jdK tools to collect data on how a Java application is

perTorming

a Understand the advantages and disadvantages of using a JIT

compiler

a Tune JVM garbage collectors to affect programs as little as possible

a Use techniques to manage heap memory and JVM native memory

a Maximize Java threading and synchronization performance

features

a Tackle per formance issues in Java EE and Java SE APls

Improve Java-driven database application performance

Scott oaks is an architect at oracle corporation where he works on the perfor

mance of Oracle's middleware software employed by sun microsystems in 1987

he became Suns Java evangelist and in 2001 joined their Java Per formance

group, which is now his primary focus. Scott has written O'reilly books on Java

Security, Java Threads, and Jin

PROGRAMMING/JAVA

口口

Twitter: oreillymedia

facebook. com/oreilly

US$449

CAN$47.99

ISBN:978-1-449-35845-7

54499

9781449135845

Java performances

The definitive guide

Scott oaks

Beijing· Cambridge.mham·Kh· Sebastopol. TokyoOREILLY

Java performance: the definitive guide

by scott oaks

Copyright C 2014 Scott Oaks. All rights reserved

Printed in the United States of america

Published by o reilly media, InC., 1005 Gravenstein Highway North, Sebastopol, CA 95472

OReilly books may be purchased for educational,business, or sales promotional use. Online editions are

alsoavailableformosttitles(http://my.safaribooksonline.com).fOrmoreinformation,contactourcorporate

institutionalsalesdepartment800-998-9938orcorporate@oreilly.com

Editor: Meghan blanchette

Indexer: Judith McConville

Production Editor: Kristen Brown

Cover Designer: Karen Montgomery

Copyeditor: Becca Freed

Interior Designer: David Futato

Proofreader: Charles roumeliotis

strator: Rebecca demarest

April 2014

First edition

Revision History for the First Edition:

2014-04-09 First release

Seehttp://oreilly.com/catalog/errata.csp?isbn=9781449358457forreleasedetails

Nutshell Handbook, the Nutshell Handbook logo, and the O Reilly logo are registered trademarks ofO Reilly

Media, Inc. Java Performance: The Definitive Guide, the image of saiga antelopes, and related trade dress are

trademarks of O Reilly Media, Inc

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as

trademarks. Where those designations appear in this book, and O Reilly Media, Inc was aware ofa trademark

claim, the designations have been printed in caps or initial caps

While every precaution has been taken in the preparation of this book, the publisher and author assume no

responsibility for errors or omissions, or for damages resulting from the use of the information contained

herein

ISBN:978-1-449-35845-7

Table of contents

Preface

1. Introduction

A Brief outline

Platforms and Conventions

JVM Tuning Flags

The Complete Performance Story

Write Better Algorithms

Write Less code

Oh Go Ahead, Prematurely optimize

22455678

Look Elsewhere: The Database Is always the bottleneck

Optimize for the Common Case

ummary

10

2. An Approach to Performance Testing

11

Test a Real application

11

Microbenchmarks

Macrobenchmarks

16

Mesobenchmarks

18

Common Code examples

20

Understand Throughput, Batching, and Response Time

24

Elapsed Time(Batch) Measurements

24

Throughput Measurements

25

Response Time Tests

26

Understand variability

29

Test early, Test Often

33

Summary

36

3. A Java performance toolbox

,37

Operating system Tools and analysis

37

CPU USage

38

The CPU Run Queue

41

Disk usage

43

Network Usage

Java Monitoring Tools

46

Basic vm information

Thread information

50

Class Information

51

Live gC analysis

51

Heap Dump Postprocessing

51

Profiling Tools

51

Sampling Profilers

52

Instrumented profilers

54

Blocking Methods and Thread Timelines

55

Native Profilers

ava mission control

Java Flight Recorder

60

Enabling

JFR

Selecting FR Events

Summary

72

4. Working with the JIT Compiler..............

Just-in-Time Compilers: An Overview

73

Hot Spot Compilation

75

Basic Tunings: Client or Server (or Both)

Optimizing Startup

Optimizing batch Operations

80

Optimizing Long-Running Applications

81

Java and JIT Compiler versions

82

Intermediate Tunings for the Compiler

85

Tuning the Code Cache

85

Compilation Thresholds

87

Inspectin

g

the Compilation Process

90

Advanced Compiler Tunings

94

Compilation Threads

94

Inlining

96

E

A

nalySiS

97

Deoptimization

8

Not entrant code

98

Deoptimizing Zombie Code

101

Tiered Compilation Levels

101

Table of contents

ummary

103

5. An Introduction to Garbage collection

105

Garbage Collection Overview

105

Generational Garbage Collectors

107

GC Algorithms

109

Choosing a gC algorithm

113

Basic Gc tuning

119

Sizing the Heap

119

Sizing the generations

122

Sizing permgen and metaspace

124

Controlling Parallelism

126

Adaptive Sizing

127

GC Tools

128

Summary

131

6. Garbage collection algorithms....................... 133

Understanding the Throughput Collector

133

Adaptive and static heap size tuning

136

Understanding the CMs Collector

140

Tuning to Solve Concurrent Mode Failures

Tuning CMS for Permgen

148

Incremental CMs

149

Understanding the Gl Collector

150

Tuning GI

157

Advanced tunings

159

Tenuring and Survivor Spaces

159

Allocating Large Objects

163

AggressiveHeap

171

Full Control Over Heap Size

173

Summary

174

7. Heap memory best practices

177

Heap analysis

177

Heap Histograms

178

Heap dumps

179

Out of Memory errors

184

g

188

Reducing Object Size

188

Lazy initialization

191

Immutable and Canonical objects

196

String interning

g

198

Table of content

Object Lifecycle management

202

Object reuse

202

Weak, Soft, and Other References

208

Summary

221

8. Native Memory Best Practices

223

Footprint

223

Measuring Footprint

224

Minimizing footprint

225

Native NIO Buffers

226

Native Memory Tracking

227

JVM Tunings for the Operating System

230

Large pages

230

C

compressed oops

234

Summary

236

9. Threading and Synchronization Performance................. 237

Thread pools and Thread Poolexecutors

237

Setting the maximum Number of Threads

238

Setting the Minimum Number of Threads

242

Thread Pool Task sizes

243

Sizing a ThreadPoolExecutor

244

The ForkJoin Pool

246

Automatic Parallelization

252

Thread Synchronization

254

Costs of Synchronization

254

Avoiding synchronization

259

False Sharing

262

JVM Thread Tunings

267

Tuning Thread Stack Sizes

267

Biased Locking

268

Lock Spinning

268

Thread Priorities

269

Monitoring Threads and Locks

270

Thread visibility

270

Blocked Thread visibility

271

ummary

275

10. Java Enterprise Edition Performance

,277

Basic Web container performance

277

Http Session State

280

Thread pools

283

ⅵi| Table of contents

Enterprise Java Session Beans

283

Tuning ejB pools

283

Tuning EJB Caches

286

Local and remote instances

288

XML and jSoN Processing

289

Data size

290

An Overview of Parsing and Marshalling

291

Choosing a Parser

293

XML Validation

299

Document models

302

Java Object Models

305

Object Serialization

307

Transient fields

307

O

iding default serializati

307

Compressing serialized data

311

K

eeping

Track of duplicate objects

31

Java EE Networking APis

316

Sizing Data Transfers

316

Summary

318

11. Database performance best practices

,321

JDBC

322

JDBC Drivers

322

Prepared Statements and Statement Pooling

324

JDBC Connection Pools

326

Transactions

327

Result set processing

335

JPA

337

Transaction Handling

337

Optimizing jPa Writes

340

Optimizing JPA Reads

342

JPA Caching

346

JPA Read-Only Entities

352

Summary

353

12. Java se api tips

,355

Buffered i/o

355

Classloading

358

Random numbers

362

ava Native interface

364

Exceptions

366

String performance

370

Table of Contents

【实例截图】

【核心代码】

java platform performance_Java Performance相关推荐

  1. [Java基础]Scanner的使用(秋招在线笔试高频使用)版本:Java™ Platform Standard Ed. 8...

    本节目讨论的Scanner为Java™ Platform Standard Ed. 8版本,请来自未来的Java同胞确认自己所处的Java版本时间线,未来的Scanner说不定已经改变了很多 最近参加 ...

  2. Java Platform Standard Edition 8 Documentation

    下面这个图挺有用的,收藏一下. Oracle has two products that implement Java Platform Standard Edition (Java SE) 8: J ...

  3. Packt发行的$ 5 Java编程书籍:精通Java 9,Java 9 High Performance

    您好极客! 今天,我们为您带来一些激动人心的消息! Java Code Geeks和Packt联手为您提供广泛的书籍库每周折扣. 本周,我们提供Java相关书籍的折扣,以帮助您理解和掌握Java. 他 ...

  4. Java Platform Module系统中的可选依赖项

    Java平台模块系统(JPMS)对依赖项有很强的见解:默认情况下,需要(必须可访问)它们,然后在编译时和运行时都将它们存在. 但是,这不适用于可选的依赖项,因为代码是针对运行时不一定存在的工件编写的. ...

  5. Java Platform SE 8(Java™编程语言)

    Java™编程语言是一种通用的,并发的,强类型,基于类的面向对象语言,它通常被编译成Java虚拟机规范中定义的字节码指令集和二进制格式. 教程和程序员的指南 Java教程 API的增强 Java SE ...

  6. Java Platform SE 8 中文文档

    Oracle拥有两个实现Java平台标准版(Java SE) 8的产品:Java SE开发工具包(JDK) 8和Java SE运行时环境(JRE) 8. JDK 8是JRE 8的超集,包含了JRE 8 ...

  7. Java Platform SE 8(Java概念图的描述)中文文档

    Java概念图将Java组件技术分类,下面列出了这些层次,从上到下,以及每个层次都包含的技术,属于较低水平的技术可以作为更高水平的一部分的基础. Java语言 Tools & Tool API ...

  8. Packt.Java.9.High.Performance.2017.11

    关注公众号,免费获取资料 ​ 在电子书栏可获取

  9. A multi-faceted language for the Java platform

    最近在研究关于groovy 相关的技术 希望有研究交到研究这方面的朋友 Groovy 最新的地址 http://www.groovy-lang.org/ 转载于:https://www.cnblogs ...

最新文章

  1. 学习笔记:腾讯云--域名解析
  2. Linux 线程的创建与同步
  3. python + ajax 实现拖动功能
  4. whois老域名挖掘技术
  5. 复化科特斯公式matlab_matlab实现复化NewtonCotes公式求积分的程序应用和代码
  6. 刚刚收到的邮件,Google对Admob的收购已经顺利结束
  7. PHP7 pecl 安装 mongodb扩展 和 PHPLIB
  8. 181215每日一句
  9. 非线性系统稳定性理论分析、设计方法
  10. html改变鼠标指针形状代码,鼠标指针形状效果大全 cursor
  11. 飞秒激光制备量子计算机,飞秒激光直写光量子逻辑门.PDF
  12. Biotin-PEG-NH2 生物素PEG氨基
  13. php curl登录,php curl实现第三方帐号登录
  14. python中multiprocessing.Manger()支持类型
  15. Python 计算思维训练——字典与字符串练习(二)
  16. 聊一聊 MYSQL 数据的真删和假删
  17. [AHK]给联想E47笔记本触摸板设定热键开关,免得误碰。
  18. 前端(微信小程序为例)
  19. sed 去掉所有的换行符
  20. uboot配置早期debug uart

热门文章

  1. 为个小善——发布 Python 库 absolute32
  2. 2022-2-19 Leetcode 1049.最后一块石头的重量II
  3. 计算机组成原理第四章ppt,计算机组成原理-第四章--指令系统.ppt
  4. Excel中IF函数中的条件写法
  5. windows下内网穿透工具Ngrok安装与使用
  6. 2021-08-19hit-oslab3进程运行的轨迹跟踪和实验统计
  7. 基于语音识别、音文同步、图像OCR的字幕解决方案HtwMedia介绍
  8. 理解Python命名机制
  9. DTMF的概念和技术
  10. 如何使用js来提交表单(fetch ajax)