title: Higher memory usage, blocked thread when using vertx circuit breaker
body: <h2>Context</h2>
  <p>I am getting high memory usage with the vertx circuit breaker. I am just using httpbin.org to get all success responses. For individual requests, it works fine. While running a load test the JVM old gen utilization is spiking up.</p>
  <h2>Reproducer</h2>
  <p>I have the main verticle code, pasting it here itself:</p>
  <pre><code>public class CleanServer extends AbstractVerticle {
  Logger logger = Logger.getLogger(CleanServer.class.getName());
  
    @Override
    public void start(Promise&lt;Void&gt; startPromise) throws Exception {
        Router router = Router.router(vertx);
        CircuitBreakerCache cbc = new CircuitBreakerCache(vertx);
        router.route(HttpMethod.GET, &quot;/get&quot;).handler(context -&gt; {
            List&lt;String&gt; domains = context.queryParam(&quot;user&quot;);
            String domain = domains.get(0);
            CircuitBreaker cb = cbc.getCircuitBreaker(domain + context.request().path());
            HttpServerResponse serverResponse =
                    context.response().setChunked(true);
            cb.executeWithFallback(promise -&gt; {
                WebClientOptions options = new WebClientOptions().setTryUseCompression(true).setTcpNoDelay(true).setTcpCork(true).setReceiveBufferSize(128).setConnectTimeout(400);
                WebClient client = WebClient.create(vertx, options);
                client.get(80, &quot;httpbin.org&quot;, &quot;/status/200&quot;)
                        .timeout(2000)
                        .send(ar -&gt; {
                            if (ar.succeeded()) {
                                HttpResponse&lt;Buffer&gt; response = ar.result();
                                int statusCode = response.statusCode();
                                if (statusCode != 200) {
                                    promise.fail(response.statusMessage());
                                } else {
                                    serverResponse.end(&quot;Hello!!&quot;);
                                    promise.complete();
                                }
                            } else {
                                promise.fail(ar.cause().getMessage());
                            }
                        });
            }, v -&gt; {
                // Executed when the circuit is opened
                logger.log(Level.INFO, domain + &quot; Failed &quot; + cb.state().toString() + &quot; Error: Circuit open&quot;);
                serverResponse.setStatusCode(200).setStatusMessage(&quot;Circuit Open&quot;).end(&quot;Circuit Open&quot;);
                return context;
            });
        });
  
        // Create the HTTP server
        vertx.createHttpServer(new HttpServerOptions().setMaxInitialLineLength(10000))
                // Handle every request using the router
                .requestHandler(router)
                // Start listening
                .listen(8080)
                // Print the port
                .onSuccess(server -&gt;
                        System.out.println(
                                &quot;HTTP server started on port &quot; + server.actualPort()
                        )
                );
  
  
    }
  }
  </code></pre>
  <h3>Circuit breaker options:</h3>
  <pre><code>CircuitBreakerOptions() 
  .setMaxFailures(50) 
  .setTimeout(5000) 
  .setFallbackOnFailure(true) 
  .setResetTimeout(10000)));
  </code></pre>
  <h2>Steps to reproduce</h2>
  <p>API used: http://localhost:8080/get?user=abc</p>
  <p>When I hit the above API at 50 QPS for 30 minutes. The java heap is getting filled up.</p>
  <h2>Extra</h2>
  <p>&lt;vertx.version&gt;4.2.6&lt;/vertx.version&gt;</p>
  <h3>JVM params used:</h3>
  <p>-XX:+UseG1GC -Xms4g -Xmx4g -XX:InitiatingHeapOccupancyPercent=70 -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5</p>
  <p>JVM memory with the load test.
  <a href="https://i.stack.imgur.com/na0dh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/na0dh.png" alt="JVM usage graph" /></a></p>
  <h3>Error:</h3>
  <p>WARNING: Thread Thread[vert.x-eventloop-thread-3,5,main] has been blocked for 3050 ms, time limit is 2000 ms</p>
  <p><em>I think I am blocking the thread somewhere but not sure where exactly as the code seems pretty simple as given in the documentation.</em></p>