"In-depth understanding of Java Virtual machines: JVM advanced properties and best practices" reading notes (updated)

Source: Internet
Author: User

Chapter One: Introduction to Java Overview Java Technology architecture History of Java Virtual machine
    • 1996 JDK1.0, the Sun Classic VM appears
    • HotSpot VM, which is a virtual machine in sun JDK and OpenJDK that was not originally developed by Sun
    • Sun mobile-embedded vm/meta-circular VM
    • Bea JROCKIT/IBM J9 VM JRockit was once known as the world's fastest Java virtual machine, the BEA company released. J9 is a major IBM-supported virtual machine
    • Azul Vm/bea Liquid VMS The "high-performance Java Virtual machine" we refer to usually refers to a commercial virtual machine running on a common platform such as HotSpot, JRockit, and J9, but in fact the specific hardware such as Azul VM and BEA Liquid vm are flat The "high-performance" weapon is the only virtual machine in the platform.
    • Apache harmony/google Android Dalvik VM
    • Microsoft JVM and other
Looking ahead to the future of Java technology
    • Modular
    • Mixed language
    • Multi-core parallelism
    • Further enrich the grammar
    • 64-bit virtual machine
Chapter Two: Java memory area and memory overflow exception JVM Runtime data area

There are five, thread-shared heap (heap), method-to-area, thread-private virtual machine stacks (VM stack), local method Stack (Native), and program counters.

  1. Program counter
    Program Counter Register is a small amount of memory space, which can be seen as the line number indicator of the byte code executed by the current thread. If the thread is executing a Java method, this counter records the address of the executing virtual machine bytecode instruction, or null (Undefined) If the Native method is being executed. This memory area is the only area in the Java Virtual Machine specification that does not stipulate any outofmemoryerror conditions.
  2. Java Virtual Machine stack
    As with program counters, the virtual machine stack is also thread-private, with the same life cycle as the thread. The virtual machine stack describes the memory model that the Java method executes: Each method creates a stack frame to store information such as local variable tables, operand stacks, dynamic links, method exits , and so on. Each method from the call until the completion of the process, corresponding to a stack frame in the virtual machine stack into the stack of the process. A local variable table holds various basic data types (Boolean, Byte, char, short, int, float, long, double), object references, and returnaddress types that are known at compile time.
    In the Java virtual machine specification, there are two exceptions to this area: if the thread requests a stack depth greater than the virtual machine allows, the STACKOVERFLOWERROR exception will be thrown, and if the virtual machine stack can be dynamically extended (most of the current Java virtual machines can be dynamically extended, but J The AVA Virtual Machine specification also allows a fixed-length virtual machine stack, which throws a OutOfMemoryError exception if the extension fails to request enough memory.
  3. Local method Stack
    The role of the local method stack and the virtual machine stack is very similar, but the difference between them is that the virtual machine stack executes Java methods (that is, bytecode) services for the virtual machine, while the local method stack is the native method service used by the virtual machine.
    As with virtual machine stacks, the local method stack area throws Stackoverflowerror and OutOfMemoryError exceptions.
  4. The Java heap Java heap is the largest piece of memory managed by a virtual machine and is a piece of memory that is shared by all threads and created when the virtual machine is started. The only purpose of this area of memory is to hold object instances where almost all of the object instances are allocated memory.
    The Java heap is the main area of garbage collector management, so it is often called a "GC heap" (garbage collected heap).
    From the memory recovery point of view, because the collector is now basically using a generational collection algorithm, so the Java heap can also be subdivided into: the new generation and the old age, the more detailed there is Eden space, from Survivor space, to Survivor space.
    According to the Java Virtual Machine specification, the Java heap can be in a physically discontinuous memory space, as long as it is logically contiguous, just like our disk space. When implemented, it can be either fixed-sized or extensible, although the current mainstream virtual machines are implemented in a scalable way (via-Xmx and-Xms control). A OutOfMemoryError exception will be thrown if there is no memory in the heap to complete the instance assignment and the heap can no longer be expanded.
  5. The method area method area is used to store data such as class information, constants, static variables, instant compiler compiled code, and so on , that have been loaded by the virtual machine. Although the Java Virtual machine specification describes the method area as a logical part of the heap, it has an alias called Non-heap (Not a heap), which should be separated from the heap.
    Many people prefer to refer to the method area as the "permanent generation" (Permanent Generation), which is essentially not equivalent, only because the design team of the HotSpot virtual machine chooses to extend the GC collection to the method area, or use the permanent generation to implement the method area. This way, the hotspot garbage collector can manage this part of the memory just like the Java heap, eliminating the effort to write memory-management code specifically for the method area, not just as a permanent band or a method area. (Java 8 has removed the permanent generation to the metadata area)
  6. Run a constant-rate pool
    Runtime Constant Pool, which is part of the method area. class file In addition to the class version, fields, methods, interfaces, and other descriptive information, a constant pool, for the compilation period generated by a variety of literal and symbolic references , which will be loaded in the class load into the method area of the run constant pool storage.
    Another important feature of running a constant pool relative to a class file's const pool is dynamic, and the Java language does not require constants to be generated only at compile time, that is, the content of the constant pool in the class file is not pre-placed to enter the method area to run the const pool, and new constants may be placed during the run The Intern () method of the String class, which is used by developers more than in the pool. A OutOfMemoryError exception is thrown when a constant pool is no longer able to request memory.
Hotspot Virtual Machine Object Quest

Take the Java heap as an example to explore the creation, memory layout, and positioning of objects.

    1. Creation of objects
    • Virtual opportunity to a new directive, first checks whether the parameter of this directive can be positioned in a constant pool to a symbolic reference of a class, and checks whether the class represented by the symbol reference has been loaded, parsed, and initialized. If not, you must first perform the appropriate class loading process.
    • After the class is loaded, a piece of memory is drawn from the Java heap to the new object. memory is allocated in a variety of ways, determined by whether the Java heap is structured, and ultimately by the garbage collector used.
    • In allocating memory to account for concurrency and threading issues, in addition to synchronous processing to guarantee atomicity, there is a method of local thread allocation buffering (thread local Allocation buffer, Tlab): Is allocating memory The actions are divided into different spaces according to the thread, which thread allocates memory, on which thread the Tlab is allocated, and only when Tlab runs out and assigns a new Tlab, the synchronization lock is required. If the virtual machine uses Tlab, it can be set by the-xx:+/-Usetlab parameter.
    • Initializes the memory space to a value of 0, which can be initialized at allocation time if Tlab is used.
    • Make the necessary settings for the object, such as which class the object is an instance of, how to find the metadata information for the class, the hash code of the object, and the age of the object's GC generation. This information resides in the object header of the object.
Memory layout of the object
    • In a HotSpot virtual machine, the layout of objects stored in memory can be divided into 3 areas: Object Header (header), instance data (Instance), and aligned padding (Padding).
    • Object header: The first part is used to store the object's own run-time data, such as hash code (HASHCODE), GC generational age, lock status flag, thread-held lock, biased thread ID, bias timestamp, etc., 32-bit and 64-bit virtual machines are 32-bit and 64-bit, the official becomes "Mark Word ". The second part of the type pointer, which is a pointer to its metadata, is the virtual machine that uses pointers to determine which class is an instance.
    • The instance part tries the object to actually store the valid information, the various types of field contents in the program.
    • The padding does not necessarily exist, it only acts as a placeholder. Guarantees that the size of the object is a multiple of 8 bytes.
Access positioning of objects

Java programs need to manipulate the concrete objects on the heap through the reference data on the stack. Because the reference type specifies only one reference to the object in the Java Virtual Machine specification, and does not define how the reference should be used to locate and access the objects in the heap, the way objects are accessed depends on the virtual machine implementation. Currently the main way to access the use of a handle and direct pointer two.

    • Handle: Then the Java heap will be divided into a block of memory as a handle pool, reference is stored in the object's handle address, and the handle contains the object instance data and type data of the respective address information .
    • Direct pointer: If you use direct pointer access, then the layout of the Java heap object must consider how to place information about the access type data, and the object address is stored directly in reference .
    • There are advantages to both object access, and the greatest benefit of using a handle to access is that the reference is stored in a stable handle address that changes only the instance data pointer in the handle when the object is moved (which is a very common behavior when the object is garbage collected), and the reference itself does not need to be modified. The biggest benefit of using direct pointer access is faster speed, which saves time spent on pointer positioning, because object access is very frequent in Java, so this overhead is a significant execution cost. For the main virtual machine discussed in this book Sun hotspot, it is the second way to access the object, but from the scope of the entire software development, various languages and frameworks use handles are also very common.
Actual combat OutOfMemoryError Anomalies
  • Java Heap Overflow Java heap is used to store object instances, as long as the object is constantly created and ensure that the GC Roots between the objects can be reached to ensure that the objects are not to be collected and recycled, it can cause heap memory overflow.
  • Virtual machine stack and local method stack overflow for HotSpot, although the-xoss parameter (set local method stack size) exists, it is actually invalid, and the stack capacity is set only by the-Xss parameter.
    A Stackoverflowerror exception is thrown if the thread requests a stack depth that is greater than the maximum allowed depth for the virtual machine.
    Throws a OutOfMemoryError exception if the virtual machine cannot request enough memory space on the scale stack.
    If a computer memory has 2G,JVM provide parameters to control the Java heap and the maximum value of the two parts of the method area memory. The remaining memory is 2GB (operating system limit) minus XMX (maximum heap capacity), minus maxpermsize (maximum method area capacity), the program counter consumes little memory and can be ignored. If the memory consumed by the virtual machine process itself is not counted, the remaining memory is "partitioned" by the virtual machine stack and the local method stack. The larger the stack capacity each thread allocates, the less natural the number of threads can be established, and the easier it is to run out of memory when the thread is established.
  • The method area and the constant pool overflow String. Intern () is a native method that, if the string constant pool already contains a string equal to this string object, returns a String object that represents the string in the pool, otherwise the string contained in this string object is added to the constant pool and returned A reference to this string object. In JDK 1. In versions 6 and earlier, because the constant pool is allocated within the permanent generation , we can limit the method area size through-xx:permsize and-xx:maxpermsize, thereby indirectly limiting the capacity of the constant pool.
  • Native Direct memory overflow directmemory capacity can be specified by-xx:maxdirectmemorysize, and if not specified, the default is the same as the Java heap maximum (-Xmx specified).
Chapter III: Garbage Collector and memory allocation policy

Garbage collection (garbage COLLECTION,GC), which was first born in 1960 of Lisp.
program counters, virtual machine stacks, local method stacks are threaded, and the three zones do not consider garbage collection. The Java heap and the method area are the areas that are primarily garbage collected.

Determine if the object has died
    • Reference counting algorithm (Reference counting)
      Add a reference counter to the object, and whenever there is a reference to it, the counter value is incremented by 1, and when the reference fails, the counter value is reduced by 1, and any object with counter 0 at any time is impossible to use again.
      Pros: High-efficiency disadvantage: There is no way to solve the problem of circular references between objects.

For a simple example, look at the TESTGC () method in Listing 3-1: Both the object Obja and OBJB have field instance, and the assignment makes Obja. Instance= OBJB and OBJB. Instance= Obja, in addition, these two objects no longer have any reference, in fact, these two objects are no longer accessible, but because they reference each other, resulting in their reference count is not 0, so the reference counting algorithm has no The GC Collector is notified to recycle them.

    • The basic idea of the algorithm (reachability analysis) is to use a series of objects called "GC Roots" as the starting point, starting from these nodes, and searching through the path called the reference chain (Reference Chain), when an object to the GC roots no reference chain connected (in the case of graph theory, that is, from gcroots to the object unreachable), it proves that this object is not available.

    • The references (definitions and classifications of references) are discussed in JDK 1. Before 2, the definition of references in Java was traditional: if the value stored in the data of the reference type represents the starting address of another piece of memory, it is said that this memory represents a reference.
      In JDK 1. After 2, Java extends the concept of references into strong references (strong Reference), soft references (Soft Reference), weak references (Weak Reference), virtual references (Phantom Reference) 4, These 4 reference intensities gradually weaken in turn.

Strong references : As long as a strong reference is never garbage collected, the definition is usually a A = new A ().

Soft References : Describes some of the more useful but not necessary properties. These objects will be listed in the Reclaim scope for a second collection before the system will have a memory overflow exception. If this collection does not have enough memory, a memory overflow exception will be thrown.

Soft Reference : Its strength is weaker than soft references, and objects associated with weak references can only survive until the next garbage collection occurs. When the garbage collector is working, the objects associated with a weak reference are reclaimed regardless of whether the current memory is sufficient.

Virtual Reference : Also become a phantom reference or phantom Reference, the weakest. The only purpose of setting a virtual reference association for an object is to be able to receive a system notification when the object is reclaimed by the collector.

To survive or to die?

To actually declare an object dead, at least two times. Marking process: If an object finds no chain of references connected to gcroots after the accessibility analysis, it will be first marked and filtered, and the condition is whether this object is required to execute the Finalize () method. When the object does not overwrite the Finalize () method, or the Finalize () method has been called by the virtual machine, the virtual machine treats both cases as "no need to execute". If the object is judged to be necessary to execute the Finalize () method, then the object will be placed in a queue called F-queue and then executed by a low-priority finalizer thread that is automatically created by the virtual machine at a later time.
The Finalize () method is the last chance for an object to escape the fate of death.

Recycling Method Area

The Java virtual machine specification does say that virtual machines can not be required to implement garbage collection in the method area, and that the "price/performance" of garbage collection in the method area is generally low: in the heap, especially in the Cenozoic, a garbage collection of conventional applications can generally reclaim 70%~95% space, and the waste collection efficiency of the permanent generation is much lower than this.

The garbage collection of the permanent generation mainly recycles two parts: obsolete constants and useless classes . Reclaiming obsolete constants is very similar to reclaiming objects in the Java heap.

How to tell if a class is useless:

    1. All instances of the class have been reclaimed, that is, no instances of the class exist in the Java heap.
    2. The ClassLoader that loaded the class have been recycled.
    3. This class corresponds to Java. The Lang class object is not referenced anywhere, and it cannot be accessed from anywhere by reflecting the method of the class.
Garbage collection Algorithm 3.1 mark-Clear algorithm

The most basic collection algorithm is the "mark-clear" (mark-sweep) algorithm, like its name, the algorithm is divided into "mark" and "clear" two stages: first mark out all the objects that need to be recycled, after the mark is complete, the unified collection of all tagged objects.

Insufficient: It has two main deficiencies: one is the efficiency problem, the efficiency of marking and clearing two processes is not high, and the other is the space problem, after the mark is cleared, there will be a lot of discontinuous memory fragmentation, too much space fragmentation may cause later when the program is running to allocate a large object, Cannot find enough contiguous memory and has to trigger another garbage collection in advance.

3.2 Copy algorithm

To solve the efficiency problem, a collection algorithm called "Replication" (Copying) appears, dividing the available memory by capacity into two blocks of equal size, using only one piece at a time. When this piece of memory is exhausted, copy the surviving object to the other piece, and then clean up the used memory space once. This makes every time the entire half of the memory collection, memory allocation will not consider the complexity of memory fragmentation, as long as the mobile heap top pointer, in order to allocate memory, easy to implement, efficient operation. But the cost of this algorithm is that the memory is reduced to half the original, it is a little too high.

Today's commercial virtual machines are using this collection algorithm to recover the new generation, IBM's special research shows that the new generation of object 98% is "dying", so do not need to divide the memory space according to the ratio of 1:1, but the memory is divided into a larger Eden space and two smaller survivo R space, each time using Eden and one piece of survivor. When recycled, the objects that are still alive in Eden and Survivor are copied one at a time into another Survivor space, finally clearing up Eden and the Survivor space just used. The default Eden and survivor size of the hotspot virtual machine is 8:1

Disadvantage: When the object survival rate is relatively high, it is necessary to carry out more replication operations, the efficiency will become lower.

3.3 Labeling-Sorting algorithm

(mark-compact) The algorithm is generally adopted in the old age.

Algorithm, the tagging process is still the same as the "mark-purge" algorithm, but the next step is not to clean up the recyclable objects directly, but rather to have all the surviving objects move toward one end, and then directly clean out the memory outside the end boundary.

3.4 Generation of collection algorithms

The current garbage collection of commercial virtual machines uses the "generational collection" (generational Collection) algorithm, which does not have any new ideas, but divides the memory into chunks based on the different life cycles of the objects. The Java heap is generally divided into the new generation and the old age, so that according to the characteristics of each era to adopt the most appropriate collection algorithm. In the Cenozoic, every garbage collection is found to have a large number of objects died, only a small number of survival, then choose the replication algorithm, only need to pay a small number of surviving objects of the replication cost can be completed collection. In the old age, because the object has a high survival rate and no extra space to guarantee it, it must be recycled using the "mark-clean" or "mark-sweep" algorithm.

The hotspot algorithm implements the 4.1 enumeration root node

In the implementation of the HotSpot, it is to use a set of data structures called Oopmap to achieve this purpose, when the class loading is complete, the HotSpot will be in the object what offset is what type of data to calculate, during the JIT compilation process, will also be in a specific position to record the stack and register Which locations are references. In this way, the GC can be directly aware of this information when it is scanned.

4.2 Safety Points

With Oopmap's assistance, hotspot can quickly and accurately complete GC Roots enumeration, but a very realistic problem follows: It can lead to a change in the reference relationship, or oopmap content changes, if you generate a corresponding oopmap for each instruction, That would require a lot of extra space, so that the GC's space costs would get very high.

In fact, the hotspot does not generate oopmap for each instruction, as mentioned earlier, only the "specific location" of the information is recorded, these locations are called security points (SafePoint), that is, the program does not stop at all places to start GC, only when the security Point to pause.

4.3 Security Zone

The safepoint mechanism ensures that when the program executes, it encounters a safepoint that can enter the GC within a very long period of time.

A security zone (safe-region) refers to a code fragment in which the reference relationship does not change. It is safe to start a GC anywhere in the region. We can also think of Safe-region as an extended safepoint.

Garbage collector

The collector discussed here is based on the hotspot virtual machine after jdk1.7update14.

5.1 Serial Collector

The Serial collector is the most basic and longest-growing collector, once the only choice for the new generation of virtual machines. The collector is a single-threaded collector that pauses other threads while it is working. "Stop the World" refers to this situation. Pros: Simple and efficient (single-line turndown with other collectors), for a single CPU-constrained environment, the serial collector can naturally get the highest single-threaded collection due to the overhead of no thread interaction.

5.2 Parnew Collector

The Parnew collector is actually a multithreaded version of the serial collector, in addition to using multiple threads for garbage collection, the rest of the behavior includes all the control parameters available to the serial collector, the collection algorithm, the Stop the world, the object assignment rule, The recycle strategy is exactly the same as the serial collector, and the two collectors share quite a lot of code in the implementation.

It is the preferred new generation collector for many virtual machines running in server mode, one that is not performance-independent but important because, in addition to the serial collector, only it can work with the CMS collector at this time.

In JDK 1. During the 5 period, HotSpot launched a garbage collector--cms collector (Concurrent Mark Sweep, which can be considered a landmark in strong interactive applications, which is described in detail later in this section), The collector is the first real concurrency (Concurrent) collector in the HotSpot virtual machine, which first implemented the garbage collection thread to work with the user thread (basically), using the previous example. Just do it. You can also throw confetti on the floor while your mother is cleaning the room. Unfortunately, CMS as a collector of the old age, but not with JDK 1. 4.0 already exists in the Cenozoic collector Parallel scavenge co-operation [1], so in JDK 1. 5 when using a CMS to collect the old age, the Cenozoic can only choose one of the parnew or Serial collectors.

5.3 Parallel Scavenge Collector

The Parallel scavenge collector is a new generation collector that also uses a collection of replication algorithms and is a parallel multi-threaded collector.

The Parallel scavenge collector is characterized by its focus on different collectors, and the focus of collectors such as CMS is to minimize the downtime of the user thread when garbage collection occurs, while Parallel scavenge The target of the collector is to achieve a controllable throughput (throughput).

5.4 Serial Old Collector

Serial old is an older version of the Serial collector, which is also a single-threaded collector, using the "mark-and-organize" algorithm. The main meaning of this collector is also to use the virtual machine in client mode. In serve mode, it has two main uses: one for JDK 1. 5 and previous versions with the Parallel scavenge collector [1], another use as a backup plan for the CMS collector, in the concurrent collection occurs when concurrent Mode failure is used.

Parallel Old Collector

Parallel old is an older version of the Parallel scavenge collector, using multithreading and the "mark-and-organize" algorithm. This collector is only available in JDK 1.6.

CMC Collector

The CMS (Concurrent Mark Sweep) collector is a collector that targets the shortest recovery pause time. At present, a large part of the Java application focus on the Internet or B/s system services, such applications pay particular attention to the response speed of the service, hope that the system pauses the shortest time, in order to bring a better experience to users.

As you can see from the name (including "Mark Sweep"), the CMS collector is implemented based on the "tag-purge" algorithm, which is more complex than the previous collectors, and is divided into 4 steps, including the following:

    • Initial tag (CMS initial mark)
    • Concurrency token (CMS concurrent mark)
    • Re-tagging (CMS remark)
    • Concurrent Purge (CMS concurrent sweep)

CMS is an excellent collector, its main advantages in the name has been reflected in: concurrent collection, low pause, some of the sun's official documents are also known as the concurrency of low-pause collector (Concurrent Collector).

Disadvantages:

    • The CMS collector is very sensitive to CPU resources.
    • The CMS collector is unable to handle floating garbage (floating garbage), and a "Concurrent Mode Failure" failure may occur resulting in another full GC.
    • The CMS is a collector based on the "tag-clear" algorithm, where a large amount of space debris is generated at the end of the collection. When there is too much space debris, large objects will be assigned a lot of trouble, often the old age still has a lot of space remaining, but can not find enough contiguous space to allocate the current object, have to trigger a full GC in advance.
5.7 G1 Collector

The G1 (Garbage-first collector is one of the most cutting-edge results of today's collector technology development, as early as JDK 1. 7 just established the project target, Sun company gives the JDK 1. 7 roadmap inside, it is considered JDK 1. An important evolutionary feature of the 7 hotspot virtual machine.

The G1 is a garbage collector for service-side applications. The mission assigned to it by the HotSpot development team is to replace JDK 1 in the future (in the longer term). The CMS collector released in 5. G1 has the following characteristics compared to other GC collectors.

    • Parallelism and concurrency
    • Collection of generations
    • Space integration
    • Predictable pauses
5.8 Understanding GC Logs

The virtual machine provides the-xx:+ printgcdetails this collector log parameter, which tells the virtual machine to print the memory reclaim log when the garbage collection behavior occurs, and outputs the current memory area allocations when the process exits. In the actual application, the memory recycling log is usually printed to the file after the analysis by the Log tool, but this experiment is not a lot of logs, direct reading can see very clearly.

Memory allocation and reclamation policy objects take precedence over Eden allocation

New Generation GC (Minor GC): Refers to the garbage collection action occurring in the Cenozoic, because most Java objects have the characteristics of being born and going out, so the Minor GC is very frequent, and the general recovery speed is relatively fast.

old age GC (Major gc/full GC): Refers to GC, which occurs in the old age, Major GC, often accompanied at least once minor GC (but not absolute, in the Parallel scavenge collector's collection strategy has a direct The policy selection process for Major GC). * * Major GC is generally more than 10 times times slower than the Minor GC. **

Large objects go straight into the old age

A large object is a Java object that requires a lot of contiguous memory space, and the most typical large object is the long string and array. Large objects are bad news for the memory allocation of virtual machines, and often large objects tend to cause memory to have plenty of space to trigger garbage collection ahead of time to get enough contiguous space to "place" them.

Long-lived objects into the old age

If the object is still alive after Eden was born and after the first Minor GC, and can be accommodated by Survivor, it will be moved to Survivor space, and the object age is set to 1. Objects in the Survivor area each "through" a Minor GC, age increased by 1 years, when its age increased to a certain extent (by default, 15 years old), will be promoted to the old age. The age threshold at which an object is promoted to the old age can be set by parameter-Xx:maxtenuringthreshold.

Dynamic Object Age Determination

If the sum of all objects of the same age in the Survivor space is greater than half the size of Survivor space, objects older than or equal to that age can enter the old age without waiting for the age required in Maxtenuringthreshold.

Space Allocation guarantee

Before the minor GC occurs, the virtual opportunity checks to see if the largest available contiguous space in the old age is greater than the total space of all new generation objects, and if this condition is true, then MINORGC can ensure that it is safe. If not, the virtual opportunity to see if the Handlepromotionfailure setting value allows the warranty to fail. If allowed, then will continue to check whether the largest available continuous space in the old age is greater than the average size of the previous promotion to the old age object, if greater than, will try to do a Minor GC, although this time the Minor GC is risky; or the Handlepromotionfailure setting does not allow for adventure, then it is also time to perform a full GC instead.

The fourth chapter: Virtual machine performance monitoring and fault handling

When we give a system a problem, the knowledge and experience are the key foundation, the data is the basis, the tool is the means of using the knowledge to process the data. The data mentioned here include: run log , exception stack, GC log, thread snapshot (threaddump/javacore file), heap dump Snapshot (heapdump/hprof file), and so on . Frequent use of appropriate virtual machine monitoring and analysis tools can accelerate our ability to analyze data and pinpoint problem resolution.

Fifth chapter: Tuning case analysis and actual combat Sixth chapter: Class file Structure seventh Chapter: Virtual machine Load Class mechanism eighth chapter: Virtual machine Bytecode Execution Engine Nineth Chapter: Class loading and executing subsystem case and actual combat tenth chapter: early (compilation period) optimization 11th chapter: Advanced (Operational) Optimization Chapter 12th: Java Memory Models and threads Chapter 13th: Thread Safety and lock optimization

"In-depth understanding of Java Virtual machines: JVM advanced properties and best practices" reading notes (updated)

Related Article

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.