Home / Type/ ResourceLeakTracker Type — netty Architecture

ResourceLeakTracker Type — netty Architecture

Architecture documentation for the ResourceLeakTracker type/interface in ResourceLeakTracker.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  b8c8b710_6bc3_10da_9510_19843e912a23["ResourceLeakTracker"]
  9575ddde_0c4f_13ed_4eb0_b45bad4e9a8b["ResourceLeakTracker.java"]
  b8c8b710_6bc3_10da_9510_19843e912a23 -->|defined in| 9575ddde_0c4f_13ed_4eb0_b45bad4e9a8b
  style b8c8b710_6bc3_10da_9510_19843e912a23 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/main/java/io/netty/util/ResourceLeakTracker.java lines 20–52

public interface ResourceLeakTracker<T>  {

    /**
     * Records the caller's current stack trace so that the {@link ResourceLeakDetector} can tell where the leaked
     * resource was accessed lastly. This method is a shortcut to {@link #record(Object) record(null)}.
     */
    void record();

    /**
     * Records the caller's current stack trace and the specified additional arbitrary information
     * so that the {@link ResourceLeakDetector} can tell where the leaked resource was accessed lastly.
     */
    void record(Object hint);

    /**
     * Close the leak so that {@link ResourceLeakTracker} does not warn about leaked resources.
     * After this method is called a leak associated with this ResourceLeakTracker should not be reported.
     *
     * @return {@code true} if called first time, {@code false} if called already
     */
    boolean close(T trackedObject);

    /**
     * Get a {@link Throwable} representing the stack trace of the original {@link #close(Object)} call.
     * If this tracker hasn't been cloesd, or close tracking isn't supported or enabled,
     * then this method returns {@code null}.
     *
     * @return A throwable with the stack trace of the successful close call, or {@code null}.
     */
    default @Nullable Throwable getCloseStackTraceIfAny() {
        return null;
    }
}

Frequently Asked Questions

What is the ResourceLeakTracker type?
ResourceLeakTracker is a type/interface in the netty codebase, defined in common/src/main/java/io/netty/util/ResourceLeakTracker.java.
Where is ResourceLeakTracker defined?
ResourceLeakTracker is defined in common/src/main/java/io/netty/util/ResourceLeakTracker.java at line 20.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free