Brief description of Java GC

Please briefly describe java garbage collection GC

The JAVA GC (Garbage Collection, garbage collection) mechanism is an important feature that distinguishes C++. C++ requires developers to implement the logic of garbage collection, while Java developers only need to focus on business development, because garbage collection is a cumbersome thing JVM Has done it for us. According to the JVM specification, the JVM divides the memory into the following areas: 1. Method Area 2. Heap 3. Virtual Machine Stack (VM Stack) 4. Native Method Stack (Native Method Stack) 5. .Program counter (Program Counter Register), in which only the method area and the heap area need to be garbage collected, and the objects to be recycled are those that do not have any references.

Guess you like

Origin blog.csdn.net/qq_40694640/article/details/112643541