title: Too many HashedWheelTimer instances
body: <p>I'm using <a href="https://github.com/cch1/http.async.client" rel="nofollow">http.async.client</a> 1.1.0 in Clojure to create websocket client. My code is almost exact <a href="https://github.com/cch1/http.async.client#websocket-client" rel="nofollow">example websocket client</a>, with added few lines of logic which:</p>
  
  <ul>
  <li>reconnect the connection on disconnect, with increasing wait times starting with few seconds and ending with about a minute</li>
  <li>code that synchronously closes the previous websocket if it exists and is open</li>
  </ul>
  
  <p>My problem is that after running this for a few days to a week I get this error message printed on console. It is not output by my logging or anything in my application, and while at first I thought it was linked to reconnects, I also get it when there are no reconnects few hours before or after.</p>
  
  <pre><code>Jul 24, 2016 6:48:18 AM org.jboss.netty.util.internal.SharedResourceMisuseDetector
  WARNING: You are creating too many HashedWheelTimer instances. HashedWheelTimer is a shared resource that must be reused across the application, so that only a few instances are created.
  </code></pre>
  
  <p>This seems to be triggered by Netty's <a href="http://netty.io/3.9/xref/org/jboss/netty/util/internal/SharedResourceMisuseDetector.html" rel="nofollow">SharedResourceMisuseDetector</a> used by the <a href="http://github.com/AsyncHttpClient/async-http-client" rel="nofollow">Asynchronous Http Client for Java</a>. This happens when there are more than 256 instances of HashedWheelTimer. I'm trying to understand what would create that many instances of HashedWheelTimer when everything points that there should be only one HashedWheelTimer. This looks like something doesn't cleanup after itself properly. Does anyone have any idea what exactly creates HashedWheelTimers and how to prevent it?</p>