GC Getting Started Guide (I) ------ Basics

Source: Internet
Author: User
In Java, the allocation and collection of object memory space are automatically performed by the jvm gc process. Java programmers do not need to manually manage the memory space as C programmers do. This is one of the many reasons why Java is popular. Next, I will introduce GC in four articles. 1. GC overview; 2. GC working principle; 3. GC collector type; 4. GC monitoring and analysis.
This is the first article in this series. I will introduce some basic knowledge such as JDK, JRE, JVM, and hot spot virtual machines. Then I will introduce the JVM architecture and Java heap memory structure. It is necessary to master this knowledge before learning GC!
Java core terms:1. java API: Helps Java programmers build a collection of class libraries for Java applications; 2.jdk: Java Development Tool Set enables Java programmers to build a series of Java program tools, including compilation, execution, management, distribution, monitoring and other aspects. 3. JVM: Java Virtual Machine (JVM). Based on the specifications of the virtual machine, virtual machines on different platforms are implemented differently. JVM shields the differences between underlying operating systems. 4. JRE: Java Runtime Environment.
Hot Spot virtual machine:Different JVM implementations may be based on different garbage collection methods. Sun used jrockit Virtual Machine before it was acquired, and Oracle used hotspot after it was acquired. In the near future, two different JVM implementations will be combined into one. The hotspot virtual machine is a core component of the Oracle se platform. The garbage collection theory in this series is based on the hotspot virtual machine.
JVM architecture:

The following illustration summarizes all the core components of a virtual machine. In the Java Virtual Machine architecture, two core components related to garbage collection are heap memory and GC recycler. Heap memory is an integral part of the runtime data zone, where Java instances will be allocated, and the GC recycler will also act in this zone.



Java heap memory:It is very important to correctly understand the role played by the Java Memory Model in the heap. during runtime, Java instances are stored in the heap memory. when an object is not referenced by any other object, it can be recycled by the garbage collector. The heap memory has three core areas: 1. new generation. 1. Eden Region
2. S0 subnet vor 3. S1 subnet vor
2. Old age. 3. Permanent generation. (Note: The permanent generation is now removed from the heap memory, that is, the current method area ).

Original article: http://javapapers.com/java/java-garbage-collection-introduction/


GC Getting Started Guide (I) ------ Basics

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.