Depth understanding of java virtual machine (b) Second Edition

How to Read This Book

The book - divided into five parts: Approaching Java, automatic memory management, virtual machine execution subsystem, the program compiled with code optimization and efficient concurrency. Each part is essentially independent of each other, not necessarily before and after dependency, from any reader can - start reading a topic of interest, but the order between the various chapters in each section -. The book does not assume the reader has a very professional level of skills in the Java space, so ensuring accurate logical premise, as much as possible about the most closely related to the virtual machine and the development of language and content in simple cases. Of course, learning virtual machine technology itself requires the reader has a solid foundation, and this book is the reader positioning, the senior programmer, so book assumes that the reader understand - the basis of some common development framework, Java API and Java syntax and so on - know how. I hope that you read this book at the same time, the practice of personally verify the contents of the book again, the list of codes which can be used from the chapter website (ttp: //www.hzbook.com) download.

Language conventions

The book in language and technology have agreed as follows: 
When the # mentioned in the book owner HotSpot, JRockit virtual machine, WebLogic Server and other products, Sun and BEA are still using the name of the company, in fact, BEA and Sun, respectively, in 2008 and 2009 the company was acquired by Oracle, both now defunct trademark, but there is no doubt that they are all made outstanding contributions in the field of Java, the programmer is worth commemorating the company.
# JDK 1.5 version from the start, in the official documents and official promotional materials no longer used similar "JDK 1.5" name, only internal programmers use the development version (Developer Version, for example, the output of java-version) before continuing follow 1.5, 1.6 and version 1.7, and open the version number (Product version) will be replaced by JDK5, JDK6 and naming of JDK7 for wording - to book for all occasions systems - using development version numbers are named. 0 Due to the layout relationship, many sample code in this book are not followed optimum coding style, such as the use of stream flow is not closed and so on, the reader note this in mind when reading. If not specified, all discussions in this book are based on Sun JDK 1.7 as a technology platform. But if there is a large variation in characteristics between each version, - - as it will explain the differences between the various versions.

Contents.

The first part approached Java

The first part of the book established a good foundation for the later explanation. Although the ins and outs of working solution Java technology, as well as difficult to compile your own OpenJDK reader understand the Java virtual machine is not required, but these preparation process can provide a good guide is approached Java technology and the Java Virtual Machine. Only the first part of Chapter 1:
Chapter 1 describes the past, present and future of a Java technology system - some trends, and describes how to independently
compile a OpenJDK 7.

The second part of the automatic memory management

Because programmers put the memory control power to the Java virtual machine, so you can enjoy the many advantages of automatic memory management in the encoding time, but precisely for this reason, - - the problem of memory leaks and spills terms of appearance and, if not Learn how to use the virtual machine memory, then the investigation will be a mistake - incredibly hard work item.

The second portion includes a second Chapter 1-5: 

Chapter 2 explains how virtual machine memory is divided, and which part of the region, what kind of code and operations may cause a memory overflow exception, and explain the various regions of the common causes of abnormal memory overflow occurs.

Chapter 3 analyzes the characteristics and operation principle of garbage collection algorithms and several garbage collector JDK1.7 provided. Through code examples demonstrate the main rules of the Java virtual machine memory allocation and automatic recovery.

Chapter 4 describes how to use the release of JDK 6 with command-line tool with two visual troubleshooting tool.
Chapter 5, to share with readers a few more representative of actual cases, also prepared a - a all developers can "real person" exercises, the reader may gain experience troubleshooting and tuning through practice.

The third part of the virtual machine execution subsystem

Crisp execution subsystem is intended to machine an essential part of understanding how virtual machine executes the program, in order to write better code.

The third portion includes a Chapter 6-9:

Chapter 6 explains the various components of the Class file structure, and define each part of the data structure and the use of methods to combat the Class Demo data file is stored and how to access.
Chapter 7 describes the "Load" class loading process, "verification", "Ready", "analysis" and "initialization" s stage in the virtual machine are carried out which actions, but also introduces the principle of class loader and its significance to the virtual machine.
Chapter 8 analyzes the virtual machine how to find the right approach in the implementation of the code, how to execute bytecode in the method and structure involved in memory to execute code.
Chapter 9 by 4 class loading and execution subsystem cases, shared some ideas worthy of appreciation and learn to use the class loader and bytecode and to deepen the understanding of theoretical knowledge through the front of a combat exercise.

The fourth program is compiled with code optimization

Java source code program is compiled into byte code from the two processes and compiled to bytecodes to machine code, in fact, equivalent to merge - a compilation process performed by a conventional compiler.

The fourth part comprises Chapters 10 through 11:

Chapter 10 analyzes the generics in the Java language, a variety of syntactic sugar active boxing and unboxing, conditional compilation and other causes and effects, and how to use the insert type annotation processor is implemented through practical demonstration - - a checking procedure naming conventions the compiler plugin.
Chapter 11 explains the focus detection method for virtual machines, HotSpot-time compilers, compiler triggers, and how to observe and analyze from the outside JIT-compiled data and results of the virtual machine, in addition, also explain some common compiler optimization techniques .
The fifth and efficient concurrent
Java language and virtual machine provides a perfect multi-native thread support, which makes it inherently suitable for development of multi-threaded applications concurrent. But we can not expect the system to complete all relevant concurrent processing concurrent also become an insider - a senior programmer indispensable course. Part V includes 12 ~ Chapter 13:
Chapter 12 explained the structure and operation of the virtual machine Java memory model, and atomicity, visibility and reflect orderliness in Java memory model, first introduced the principles of the rule occurs and use, but also to understand the threads in the Java language is how to achieve.
Chapter 13 introduces the concept and classification of thread safety involved, and the way the principle underlying the operation of the virtual machine synchronous implementation, and introduced virtual machine for efficient concurrent taken - - Series lock optimization measures.

 

Published 298 original articles · won praise 107 · Views 140,000 +

Guess you like

Origin blog.csdn.net/ywl470812087/article/details/105023961