Deep understanding of Java Virtual Machine: JVM advanced features and best practices (in-depth analysis of JVM Based on issues such as memory management and high concurrency)

Source: Internet
Author: User
Tags field table

Deep understanding of Java Virtual Machine: JVM advanced features and best practices (in-depth analysis of JVM Based on issues such as memory management and high concurrency)

Provides a comprehensive and in-depth analysis of JVM based on core content such as memory management, execution subsystem, programming compilation and optimization, and efficient concurrency. This deeply reveals the working principle of JVM.

Focuses on implementation to solve difficult problems in practice, including a large number of classic cases and best practices

Basic Information

Author:Zhou Zhiming
[Introduction to translators]

Series Name:Original huazhan boutique

Press: Machinery Industry Press

ISBN:9787111349662

Mounting time:

Published on: February 1, June 2011

Http://product.china-pub.com/194035


Introduction

As a Java programmer, have you ever wanted to understand the Java Virtual Machine in depth, but have you been rejected by its complexity and depth? It doesn't matter. A deep understanding of Java Virtual Machine: JVM advanced feature
Nature and best practices are simplified and simplified, allowing you to easily learn the secrets of Java virtual machines. Deep understanding of Java Virtual Machine: Advanced JVM features and best practices has been published in China in recent years.
The only monograph related to Java virtual machine is also the only one that explores Java Virtual Machine from both the core theory and practical use. It not only thoroughly analyzes the theory, but also contains
Typical Cases and best practices are also of practical guiding significance.
  
The book is divided into five parts. The first part introduces the past, present and future of the entire Java technical system from a macro perspective, and how to compile an openjdk7 independently.
Very helpful. The second part describes the automatic memory management of JVM, including the partitioning principle of the memory area of the Virtual Machine and the causes of various memory overflow exceptions. Common garbage collection algorithms and the characteristics of the Garbage Collector
And working principles; Principles and usage of common Virtual Machine Monitoring and debugging tools. The third part analyzes the virtual machine execution subsystem, including the file structure of the class and how to store and access the class
Data in the VM; the Virtual Machine class creation mechanism and the working principle of the class loader and its significance to the virtual machine; the execution engine of the Virtual Machine bytecode and the memory structure involved in code implementation. The fourth part explains the program
Compilation and code optimization, describes the principles of syntax sugar such as generic, automatic packing and unpacking, and Conditional compilation; describes the hotspot detection methods of virtual machines, the real-time compiler of hotspot, the compilation trigger conditions, and
How to observe and analyze jit-compiled data and results from outside the virtual machine. The fifth part discusses the principles of Java's efficient concurrency, including the structure and operations of the JVM memory model, atomicity, visibility, and order.
Features are embodied in the Java memory model; Rules and usage of the first occurrence principle; implementation principle of threads in the Java language; a series of lock optimization measures made by virtual machines to achieve efficient concurrency.
  
A deep understanding of Java Virtual Machine: JVM advanced features and best practices is suitable for all Java programmers, system tuning engineers, and system architects.

Directory

Deep understanding of Java Virtual Machine: Advanced JVM features and best practices

Preface

Thank you

The first part approaches Java

Chapter 2 approaching Java/2

1.1 Overview/2

1.2 Java Technical System/3

1.3 Java Development History/5

1.4 outlook on the future of Java technology/9

1.4.1 modularization/9

1.4.2 mixed language/9

1.4.3 multi-core parallel/11

1.4.4 further enrich the syntax/12

1.4.5 64-bit Virtual Machine/13

1.5 practice: Compile JDK/13 by yourself

1.5.1 obtain JDK source code/13

1.5.2 system requirements/14

1.5.3 build the compiling environment/15

1.5.4 prepare dependencies/17

1.5.5 compile/18

. 1.6 Summary of this chapter/21

Part 2 Automatic Memory Management

Chapter 4 Java memory zone and memory overflow exceptions/24

2.1 Overview/24

2.2 runtime data zone/25

2.2.1 program counter/25

2.2.2 Java Virtual Machine stack/26

2.2.3 local method stack/27

2.2.4 Java Heap/27

2.2.5 Method Area/28

2.2.6 runtime frequency pool/29

2.2.7 Direct Memory/29

2.3 Object Access/30

2.4 practice: outofmemoryerror/32

2.4.1 Java heap overflow/32

2.4.2 VM stack and local method stack overflow/35

2.4.3 runtime frequent pool overflow/38

2.4.4 method overflow/39

2.4.5 local direct memory overflow/41

2.5 Summary of this chapter/42

Chapter 3 garbage collector and Memory Allocation Policy/43

3.1 Overview/43

3.2 is the object dead? /44

3.2.1 reference counting algorithm/44

3.2.2 root search algorithm/46

3.2.3 further reference/47

3.2.4 survival or death? /48

3.2.5 recycling method area/50

3.3 garbage collection algorithm/51

3.3.1 mark-clear algorithm/51

3.3.2 copy algorithm/52

3.3.3 tagging-sorting algorithm/54

3.3.4 generation collection algorithm/54

3.4 Garbage Collector/55

3.4.1 serial collector/56

3.4.2 parnew collector/57

3.4.3 parallel scavenge collector/59

3.4.4 serial old collector/60

3.4.5 parallel old collector/61

3.4.6 CMS collector/61

3.4.7 G1 collector/64

3.4.8 Summary of Garbage Collector parameters/64

3.5 memory allocation and recovery policies/65

3.5.1 priority for objects allocated in Eden/66

3.5.2 large objects directly enter the old age/68

3.5.3 objects that survive for a long time will enter the old age/69

3.5.4 Dynamic Object age determination/71

3.5.5 space allocation guarantee/73

3.6 summary of this chapter/75

Chapter 2 VM performance monitoring and troubleshooting tools/76

4.1 Overview/76

4.2 JDK command line tool/76

4.2.1 JPs: Virtual Machine Process status tool/79

4.2.2 jstat: Virtual Machine statistics monitoring tool/80

4.2.3 jinfo: Java configuration information tool/82

4.2.4 jmap: Java memory image tool/82

4.2.5 jhat: Virtual Machine heap snapshot analysis tool/84

4.2.6 jstack: java stack tracing tool/85

4.3 JDK visualization tools/87

4.3.1 jconsole: Java Monitoring and Management Console/88

4.3.2 visualvm: Multi-in-One troubleshooting tool/96

4.4 summary of this chapter/105

Chapter 1 Optimization case analysis and practice/5th

5.1 Overview/106

5.2 case analysis/106

5.2.1 application deployment policy on high-performance hardware/106

5.2.2 memory overflow caused by inter-cluster synchronization/109

5.2.3 off-heap memory overflow error/110

5.2.4 system slowness caused by external commands/112

5.2.5 server JVM process crash/113

5.3 practice: Eclipse Running Speed tuning/114

5.3.1 program running status before optimization/114

5.3.2 performance changes and compatibility issues during JDK 1.6 upgrade/117

5.3.3 Optimization of Compilation Time and class loading time/122

5.3.4 adjust the memory settings to control the garbage collection frequency/126

5.3.5 select collector to reduce latency/130

5.4 summary of this chapter/133

Part 3 Virtual Machine execution Subsystem

Chapter 4 class file structure/6th

6.1 Overview/136

6.2 The cornerstone of independence/136

6.3 structure of class files/138

6.3.1 magic number and class file version/139

6.3.2 constant pool/141

6.3.3 access Mark/147

6.3.4 category index, parent index, and interface index set/148

6.3.5 field table set/149

6.3.6 method table set/153

6.3.7 Attribute Table set/155

6.4 development of the class file structure/168

6.5 summary of this chapter/170

Chapter 4 Virtual Machine Loading Mechanism/7th

7.1 Overview/171

7.2 class loading time/172

7.3 class loading process/176

7.3.1 load/176

7.3.2 authentication/178

7.3.3 preparation/181

7.3.4 resolution/182

7.3.5 initialization/186

7.4 class loaders/189

7.4.1 Class and Class loaders/189

7.4.2 parental assignment model/191

7.4.3 damage the Parent-Child Delegation Model/194

7.5 summary of this chapter/197

Chapter 2 Virtual Machine bytecode execution engine/8th

8.1 Overview/198

8.2 runtime stack frame structure/199

8.2.1 local variable table/199

8.2.2 operand stack/204

8.2.3 dynamic connections/206

8.2.4 method return URL/206

8.2.5 additional information/207

8.3 method call/207

8.3.1 resolution/207

8.3.2 dispatch/209

8.4 stack-based bytecode interpretation execution engine/221

8.4.1 interpretation execution/221

8.4.2 stack-based instruction sets and register-based instruction sets/223

8.4.3 stack-based interpreter Execution Process/224

8.5 summary of this chapter/230

Chapter 4 case study and practice of class loading and execution subsystem/9th

9.1 Overview/231

9.2 case analysis/231

9.2.1 Tomcat: Orthodox Class Loader architecture/232

9.2.2 osgi: flexible Class Loader architecture/235

9.2.3 Implementation of bytecode Generation Technology and dynamic proxy/238

9.2.4 skip Translator: JDK version/242

9.3 practice: implement remote execution by yourself/246

9.3.1 objective/246

9.3.2 train of thought/247

9.3.3 Implementation/248

9.3.4 verification/255

9.4 summary of this chapter/256

Part 4 program compilation and code optimization

Chapter 2 early (Compilation) optimization/10th

10.1 Overview/258

10.2 javac Compiler/259

10.2.1 javac source code and debugging/259

10.2.2 parsing and filling symbol table/262

10.2.3 annotation processor/264

10.2.4 Semantic Analysis and bytecode generation/264

10.3 taste of Java syntax sugar/268

10.3.1 generic and type erasure/268

10.3.2 automatic packing, unpacking and traversing cycle/273

10.3.3 Conditional compilation/275

10.4 practice: plug-in Annotation processor/276

10.4.1 Practice goal/276

10.4.2 code implementation/277

10.4.3 running and testing/284

10.4.4 other application cases/286

10.5 summary of this chapter/286

Chapter 4 optimization of the late stage (Operation Period)/11th

11.1 Overview/287

11.2 real-time compiler in hotspot Virtual Machine/288

11.2.1 interpreter and compiler/288

11.2.2 compile object and trigger condition/291

11.2.3 compilation process/294

11.2.4 view and analyze real-time compilation results/297

11.3 compilation optimization technology/301

11.3.1 optimization technology Overview/301

11.3.2 elimination of common subexpressions/305

11.3.3 array boundary check elimination/307

11.3.4 method inline/307

11.3.5 escape analysis/309

11.4 comparison between Java and C/C ++ compilers/311

11.5 summary of this chapter/313

Part 5 efficient concurrency

Chapter 2 Java Memory Model and thread/12th

12.1 Overview/316

12.2 hardware efficiency and consistency/317

12.3 Java memory model/318

12.3.1 primary memory and working memory/319

12.3.2 memory interaction operation/320

12.3.3 special rules for volatile variables/322

12.3.4 special rules for long and double variables/327

12.3.5 atomicity, visibility, and orderliness/328

12.3.6 principle of first occurrence/330

12.4 Java and thread/333

12.4.1 thread Implementation/333

12.4.2 Java thread scheduling/337

12.4.3 status transition/339

12.5 summary of this chapter/341

Chapter 4 thread security and lock optimization/13th

13.1 Overview/342

13.2 thread security/343

13.2.1 thread security in Java/343

13.2.2 Implementation of thread security/348

13.3 lock optimization/356

13.3.1 spin lock and adaptive spin/356

13.3.2 lock elimination/357

13.3.3 lock roughening/358

13.3.4 lightweight lock/358

13.3.5 biased lock/361

13.4 summary of this chapter/362

Appendix A Java Virtual Machine family/363

Appendix B virtual machine bytecode instruction table/366

Appendix C main parameter table of hotspot VM/372

Appendix D introduction to Object Query Language (oql)/376

Appendix e jdk History version track/383

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.