About 282,000 results
Open links in new tab
  1. Guide to Garbage Collector Roots - Baeldung

    Jan 8, 2024 · In this tutorial, we’ll learn what the Garbage Collector Roots (GC roots) are. Additionally, we’ll describe the types of GC roots. Afterward, we’ll show the difference between GC roots and live objects.

  2. java - What are GC roots for classes? - Stack Overflow

    Nov 28, 2014 · In Java, there are special objects called Garbage Collection Roots (GC roots). They serve as a root objects for Garbage Collection marking mechanism (see picture). This article describes four types of GC roots: local variables; active threads; static variables ; JNI references; It is also mentioned, that: Classes themselves can be garbage ...

  3. Understanding Java GC Roots: A Beginner's Guide to Garbage Collection

    This tutorial delves into the concept of GC Roots in Java, explaining their role in garbage collection. By grasping this concept, developers can optimize memory usage, reduce the risk of memory leaks, and design more efficient applications.

  4. Garbage Collection in Java - GeeksforGeeks

    Apr 8, 2025 · There are generally four ways to make an object eligible for garbage collection. Nullifying the reference variable (obj = null). Re-assigning the reference variable (obj = new Object ()). An object created inside the method (eligible after method execution).

  5. Understanding garbage collection in Java : GC roots - YourKit

    What is the garbage collector roots (GC roots) in Java? In Java, the process of automatically freeing up memory that is no longer in use is known as garbage collection (GC). The garbage collector identifies objects that are no longer needed and then reclaims the memory that was allocated to them.

  6. Garbage Collection in Java – What is GC and How it Works in …

    Jan 22, 2021 · What are Garbage Collection Roots in Java? Garbage collectors work on the concept of Garbage Collection Roots (GC Roots) to identify live and dead objects. Examples of such Garbage Collection roots are: Classes loaded by system class loader (not custom class loaders) Live threads; Local variables and parameters of the currently executing methods

  7. How Java Garbage Collection Works - Dynatrace

    Special objects called garbage-collection roots (GC roots; see Figure 2.2) are always reachable and so is any object that has a garbage-collection root at its own root. There are four kinds of GC roots in Java: Local variables are kept alive by the stack of a thread. This is not a real object virtual reference and thus is not visible.

  8. Heap and Garbage Collection in Java | by Nigar Atakishiyeva

    Dec 15, 2024 · Java Native Interface (JNI) references — Objects created by the native code as part of a JNI call. This is a very special case of GC roots because the JVM does not know whether the objects...

  9. Garbage Collection Roots - Eclipse

    A garbage collection root is an object that is accessible from outside the heap. The following reasons make an object a GC root: Class loaded by bootstrap/system class loader. For example, everything from the rt.jar like java.util.* . Local variable in native code, such as user defined JNI code or JVM internal code.

  10. Garbage Collection in Java: How It Works - codersjungle.com

    Dec 12, 2024 · When a garbage collection cycle starts, the garbage collector will traverse this root set to identify all reachable objects. Any object that cannot be reached from the root set is marked for collection. This approach ensures that only unused …

  11. Some results have been removed
Refresh