Home / Function/ testLeakSetupHints() — netty Function Reference

testLeakSetupHints() — netty Function Reference

Architecture documentation for the testLeakSetupHints() function in ResourceLeakDetectorTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  40eac971_57ce_a823_9aa4_d286a3352324["testLeakSetupHints()"]
  b9315c3d_21bb_7c58_f151_90c8040eed69["ResourceLeakDetectorTest"]
  40eac971_57ce_a823_9aa4_d286a3352324 -->|defined in| b9315c3d_21bb_7c58_f151_90c8040eed69
  57aeb634_0e1f_2f43_bfbc_c001da533bd3["initialise()"]
  40eac971_57ce_a823_9aa4_d286a3352324 -->|calls| 57aeb634_0e1f_2f43_bfbc_c001da533bd3
  9e543dfe_5122_4300_2978_1c4fe82e51f6["leakResource()"]
  40eac971_57ce_a823_9aa4_d286a3352324 -->|calls| 9e543dfe_5122_4300_2978_1c4fe82e51f6
  70f8812a_9703_dba6_5d96_f3220a8fb1ec["getLeaksFound()"]
  40eac971_57ce_a823_9aa4_d286a3352324 -->|calls| 70f8812a_9703_dba6_5d96_f3220a8fb1ec
  40cbe14c_de4c_aa61_37d9_4da04da1e233["close()"]
  40eac971_57ce_a823_9aa4_d286a3352324 -->|calls| 40cbe14c_de4c_aa61_37d9_4da04da1e233
  bea399c2_041c_146d_4bb8_c499ee67b437["assertNoErrors()"]
  40eac971_57ce_a823_9aa4_d286a3352324 -->|calls| bea399c2_041c_146d_4bb8_c499ee67b437
  style 40eac971_57ce_a823_9aa4_d286a3352324 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/test/java/io/netty/util/ResourceLeakDetectorTest.java lines 108–128

    @Timeout(10)
    @Test
    public void testLeakSetupHints() throws Throwable {
        DefaultResource.detectorWithSetupHint.initialise();
        leakResource();

        do {
            // Trigger GC.
            System.gc();
            // Track another resource to trigger refqueue visiting.
            Resource resource2 = new DefaultResource();
            DefaultResource.detectorWithSetupHint.track(resource2).close(resource2);
            // Give the GC something to work on.
            for (int i = 0; i < 1000; i++) {
                sink = System.identityHashCode(new byte[10000]);
            }
        } while (DefaultResource.detectorWithSetupHint.getLeaksFound() < 1 && !Thread.interrupted());

        assertThat(DefaultResource.detectorWithSetupHint.getLeaksFound()).isOne();
        DefaultResource.detectorWithSetupHint.assertNoErrors();
    }

Domain

Subdomains

Frequently Asked Questions

What does testLeakSetupHints() do?
testLeakSetupHints() is a function in the netty codebase, defined in common/src/test/java/io/netty/util/ResourceLeakDetectorTest.java.
Where is testLeakSetupHints() defined?
testLeakSetupHints() is defined in common/src/test/java/io/netty/util/ResourceLeakDetectorTest.java at line 108.
What does testLeakSetupHints() call?
testLeakSetupHints() calls 5 function(s): assertNoErrors, close, getLeaksFound, initialise, leakResource.

Analyze Your Own Codebase

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

Try Supermodel Free