title: Netty Webclient memory leak in spring boot
body: <p>Hi all we are seeing app crash under heavy load when we analyze our heap dump major memory is taken by netty below the following leak suspect</p>
  <pre><code>218,618,256 bytes (63.15 %) of Java heap is used by 24 instances of io/netty/buffer/PoolArena$HeapArena
   Contains 12 instances of the following leak suspects:
   - byte[] holding 16,777,224 bytes at 0x711b00000
   - byte[] holding 16,777,224 bytes at 0x710a00000
   - byte[] holding 16,777,224 bytes at 0x70ea00000
   - byte[] holding 16,777,224 bytes at 0x708500000
   - byte[] holding 16,777,224 bytes at 0x70d900000
   - byte[] holding 16,777,224 bytes at 0x70c800000
   - byte[] holding 16,777,224 bytes at 0x71ea00000
   - byte[] holding 16,777,224 bytes at 0x716c00000
   - byte[] holding 16,777,224 bytes at 0x715900000
   - byte[] holding 16,777,224 bytes at 0x705c00000
   - byte[] holding 16,777,224 bytes at 0x704b00000
   - io/netty/buffer/PoolChunk holding 33,609,288 bytes at 0x71d476ad8
  </code></pre>
  <p>we are using only 6 instance of webclient why it is showing 12 instance? why it is not releasing memory? can anyone guide us on this.</p>
  <p>WebClient request</p>
  <pre class="lang-java prettyprint-override"><code>    public &lt;T&gt; Mono&lt;T&gt; sendGetRequest(String apiBaseUrl, String apiEndpoint, String queryParams, HttpHeaders headers, Class&lt;T&gt; clazz, Map&lt;String, String&gt; params) {
              return webClient.get()
                      .uri(apiBaseUrl + apiEndpoint, params).headers(getHttpHeaders(headers))
                      .retrieve()
                      .bodyToMono(clazz);
          }
  </code></pre>