Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

GC roots

Pragya Keshap answered on February 20, 2023 Popularity 3/10 Helpfulness 2/10

Contents


More Related Answers

  • GC Statistics

  • GC roots

    0

    Each tree of an object has one or more objects at the root. If the garbage collector can reach the root, the tree is reachable. Any object that is not reached by, or referenced by, GC roots is considered dead and the garbage collector removes it.

    Here are the different kinds of GC roots in Java:

    Local variables: Variables or parameters of a Java method.

    Active threads: A running thread is a live object.

    Static variables: Classes referencing static variables. When the garbage collector collects classes, it removes references to static variables.

    JNI references: Object reference created during the JNI call. They are kept alive because JVM is unaware that the native code has references of it. 

    Popularity 3/10 Helpfulness 2/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Feb 20 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.