Home / Function/ reportLeak() — netty Function Reference

reportLeak() — netty Function Reference

Architecture documentation for the reportLeak() function in ResourceLeakDetector.java from the netty codebase.

Function java CommonUtil Concurrent calls 5 called by 1

Entity Profile

Dependency Diagram

graph TD
  c749ac7c_d251_baf5_8030_89fe234647d9["reportLeak()"]
  f4ad5acd_fee3_2377_9c2f_bc298798ad25["ResourceLeakDetector"]
  c749ac7c_d251_baf5_8030_89fe234647d9 -->|defined in| f4ad5acd_fee3_2377_9c2f_bc298798ad25
  6c6ec55a_3aba_b916_b994_11cf7c27c631["track0()"]
  6c6ec55a_3aba_b916_b994_11cf7c27c631 -->|calls| c749ac7c_d251_baf5_8030_89fe234647d9
  82cad144_74fd_b0ed_11b2_7980d2760619["needReport()"]
  c749ac7c_d251_baf5_8030_89fe234647d9 -->|calls| 82cad144_74fd_b0ed_11b2_7980d2760619
  e96112df_51ca_7e3f_05c2_3a8b99f89a09["clearRefQueue()"]
  c749ac7c_d251_baf5_8030_89fe234647d9 -->|calls| e96112df_51ca_7e3f_05c2_3a8b99f89a09
  836a7c81_609c_0085_1045_b69a2142ec31["dispose()"]
  c749ac7c_d251_baf5_8030_89fe234647d9 -->|calls| 836a7c81_609c_0085_1045_b69a2142ec31
  a55afc47_a23a_76cf_3401_5ccab38abea9["reportUntracedLeak()"]
  c749ac7c_d251_baf5_8030_89fe234647d9 -->|calls| a55afc47_a23a_76cf_3401_5ccab38abea9
  baca799b_2fe2_1e2b_9380_ae306fbf77a7["reportTracedLeak()"]
  c749ac7c_d251_baf5_8030_89fe234647d9 -->|calls| baca799b_2fe2_1e2b_9380_ae306fbf77a7
  style c749ac7c_d251_baf5_8030_89fe234647d9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/main/java/io/netty/util/ResourceLeakDetector.java lines 311–342

    private void reportLeak() {
        if (!needReport()) {
            clearRefQueue();
            return;
        }

        // Detect and report previous leaks.
        for (;;) {
            DefaultResourceLeak<?> ref = (DefaultResourceLeak<?>) refQueue.poll();
            if (ref == null) {
                break;
            }

            if (!ref.dispose()) {
                continue;
            }

            String records = ref.getReportAndClearRecords();
            if (reportedLeaks.add(records)) {
                if (records.isEmpty()) {
                    reportUntracedLeak(resourceType);
                } else {
                    reportTracedLeak(resourceType, records);
                }

                LeakListener listener = leakListener;
                if (listener != null) {
                    listener.onLeak(resourceType, records);
                }
            }
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does reportLeak() do?
reportLeak() is a function in the netty codebase, defined in common/src/main/java/io/netty/util/ResourceLeakDetector.java.
Where is reportLeak() defined?
reportLeak() is defined in common/src/main/java/io/netty/util/ResourceLeakDetector.java at line 311.
What does reportLeak() call?
reportLeak() calls 5 function(s): clearRefQueue, dispose, needReport, reportTracedLeak, reportUntracedLeak.
What calls reportLeak()?
reportLeak() is called by 1 function(s): track0.

Analyze Your Own Codebase

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

Try Supermodel Free