What is GC Roots

Source: Internet
Author: User

GC RootNovember 28, 2012? Integrated? A total of 625 words? SizeXiao Zhong da? Comments Off

Often referred to as GC (garbage Collector) roots, specifically the garbage collector (garbage Collector) objects, the GC collects those objects that are not GC roots and are not referenced by GC roots.

An object can belong to more than one ROOT,GC root with several sowing:

    • Class-Objects loaded by the System class loader (loader), which cannot be recycled, can hold other objects in the same way as static fields. One thing we should be aware of is that classes loaded through the user-defined class loader are not roots unless the corresponding Java.lang.Class instances become roots in some other (or more) way.
    • Thread-Alive Threads
    • The local variable or parameter of the Stack local -Java method
    • Local variable or parameter of the JNI local -Jni method
    • JNI Global-Global JNI reference
    • Monitor used -monitoring objects for synchronization
    • Held by JVM -objects reserved for the special purpose of the JVM by the GC, but this is actually related to the implementation of the JVM. Some of the types that may be known are the system ClassLoader, the important exception classes that some JVMs know, some pre-allocated objects for handling exceptions, and some custom class loaders. However, the JVM does not provide additional information for these objects, so it is necessary to determine what belongs to the "JVM hold".

What is GC Roots

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.