npahucki/vert.x — pull request #3 by wangjunbo924 (2013-09-18 06:55:12+00:00)
Title: fix OOM issue on abus server

fix OOM issue. In some cases, the vertx ClientConnection and it's refered NioSocketChannel is actually unvailable but it still kept in the connection pool. It can accept client requests and add them to its internal queue for later consuming. However the consuming will never happen because it's the zombie NioSocketChannel throw out exception only and then the connection is returned to the pool to accept annother request. There is no chance to remove request from the internal queue. So the connection holds more and more requests. Since the connection can be reached by GC root so all it's refered connections are reachable too. That's the cause of OOM.

How to fix: there might be some other cases which leads the same issue so the best way to fix it is close the underlying channel whenever exception caught. And the connection will be released as well. Actually, the same fix was commited to eclipse/vert.x master branch already. The adsk fork is a little out-dated.

Tests:
a whole night of events publishing/consuming (the adapter to handle events is stopped)