Without my changes I can successfully reproduce the leak running the `unfiltered-netty-server/test` task.

(I had to add a `sys.runtime.gc()` call to the Resources.intent in order to trigger it reliably.)

Alas, a CompositeByteBuf does not record its recent accesses which makes it hard to track them down. So I fired up ByteMan with this rule loaded:

```
RULE record CompositeByteBuf leaks
CLASS ^io.netty.buffer.CompositeByteBuf
METHOD capacity()
AT EXIT
IF true
DO $0.leak.record()
ENDRULE
```
and changed the unfiltered.netty.RequestBinding uri method to
```scala
  def uri =  { content.foreach(_.content().capacity) ; req.getUri }
```
This was the output:

```
Jun 04, 2014 1:33:50 PM io.netty.util.ResourceLeakDetector reportLeak
SEVERE: LEAK: ByteBuf.release() was not called before it's garbage-collected.
Recent access records: 1
#1:
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        java.lang.reflect.Method.invoke(Method.java:483)
        org.jboss.byteman.rule.expression.MethodExpression.interpret(MethodExpression.java:342)
        org.jboss.byteman.rule.Action.interpret(Action.java:144)
        org.jboss.byteman.rule.helper.InterpretedHelper.fire(InterpretedHelper.java:169)
        org.jboss.byteman.rule.helper.InterpretedHelper.execute0(InterpretedHelper.java:137)
        org.jboss.byteman.rule.helper.InterpretedHelper.execute(InterpretedHelper.java:100)
        org.jboss.byteman.rule.Rule.execute(Rule.java:684)
        org.jboss.byteman.rule.Rule.execute(Rule.java:653)
        io.netty.buffer.CompositeByteBuf.capacity(CompositeByteBuf.java:488)
        unfiltered.netty.RequestBinding$$anonfun$uri$1.apply(bindings.scala:70)
        unfiltered.netty.RequestBinding$$anonfun$uri$1.apply(bindings.scala:70)
        scala.Option.foreach(Option.scala:236)
        unfiltered.netty.RequestBinding.uri(bindings.scala:70)
        unfiltered.request.Path$.unapply(paths.scala:4)
        unfiltered.netty.Resources$$anonfun$intent$1.applyOrElse(resources.scala:77)
        unfiltered.netty.Resources$$anonfun$intent$1.applyOrElse(resources.scala:76)
        scala.PartialFunction$Lifted.apply(PartialFunction.scala:218)
        scala.PartialFunction$Lifted.apply(PartialFunction.scala:214)
        unfiltered.response.Pass$PartialAttempt.attemptWithPass(pass.scala:72)
        unfiltered.response.Pass$PassingAttempt$class.attempt(pass.scala:65)
        unfiltered.response.Pass$PartialAttempt.attempt(pass.scala:67)
        unfiltered.response.Pass$OnPassAttempt.apply(pass.scala:88)
        unfiltered.netty.async.RequestPlan$class.channelRead(plans.scala:47)
        unfiltered.netty.Resources.channelRead(resources.scala:56)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
*** CompositeByteBuf(ridx: 0, widx: 0, cap: 0, components=0) capacity 0
        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)
        io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:126)
        io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:507)
        io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:464)
        io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:378)
        io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350)
        io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
        java.lang.Thread.run(Thread.java:745)
Created at:
        io.netty.buffer.CompositeByteBuf.<init>(CompositeByteBuf.java:59)
        io.netty.buffer.Unpooled.compositeBuffer(Unpooled.java:355)
        io.netty.handler.codec.http.HttpObjectAggregator.decode(HttpObjectAggregator.java:147)
        io.netty.handler.codec.http.HttpObjectAggregator.decode(HttpObjectAggregator.java:52)
        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)
        io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:126)
        io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:507)
        io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:464)
        io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:378)
        io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350)
        io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
        java.lang.Thread.run(Thread.java:745)
```
With the patch applied, the leak is gone.

---

Running the all tests again with the ByteMan rule activated, points to this culprit:

```
SEVERE: LEAK: ByteBuf.release() was not called before it's garbage-collected.
Recent access records: 2
#2:
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        java.lang.reflect.Method.invoke(Method.java:483)
        org.jboss.byteman.rule.expression.MethodExpression.interpret(MethodExpression.java:342)
        org.jboss.byteman.rule.Action.interpret(Action.java:144)
        org.jboss.byteman.rule.helper.InterpretedHelper.fire(InterpretedHelper.java:169)
        org.jboss.byteman.rule.helper.InterpretedHelper.execute0(InterpretedHelper.java:137)
        org.jboss.byteman.rule.helper.InterpretedHelper.execute(InterpretedHelper.java:100)
        org.jboss.byteman.rule.Rule.execute(Rule.java:684)
        org.jboss.byteman.rule.Rule.execute(Rule.java:653)
        io.netty.buffer.CompositeByteBuf.capacity(CompositeByteBuf.java:488)
        unfiltered.netty.RequestBinding$$anonfun$uri$1.apply(bindings.scala:70)
        unfiltered.netty.RequestBinding$$anonfun$uri$1.apply(bindings.scala:70)
        scala.Option.foreach(Option.scala:236)
        unfiltered.netty.RequestBinding.uri(bindings.scala:70)
        unfiltered.netty.websockets.WSLocation$.apply(plans.scala:33)
        unfiltered.netty.websockets.Plan$class.upgrade(plans.scala:76)
        unfiltered.netty.websockets.Plan$class.channelRead(plans.scala:52)
        unfiltered.netty.websockets.Planify$Planned.channelRead(plans.scala:172)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)
        io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:126)
        io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:507)
        io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:464)
        io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:378)
        io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350)
        io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
        java.lang.Thread.run(Thread.java:745)
#1:
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        java.lang.reflect.Method.invoke(Method.java:483)
        org.jboss.byteman.rule.expression.MethodExpression.interpret(MethodExpression.java:342)
        org.jboss.byteman.rule.Action.interpret(Action.java:144)
        org.jboss.byteman.rule.helper.InterpretedHelper.fire(InterpretedHelper.java:169)
        org.jboss.byteman.rule.helper.InterpretedHelper.execute0(InterpretedHelper.java:137)
        org.jboss.byteman.rule.helper.InterpretedHelper.execute(InterpretedHelper.java:100)
        org.jboss.byteman.rule.Rule.execute(Rule.java:684)
        org.jboss.byteman.rule.Rule.execute(Rule.java:653)
        io.netty.buffer.CompositeByteBuf.capacity(CompositeByteBuf.java:488)
        unfiltered.netty.RequestBinding$$anonfun$uri$1.apply(bindings.scala:70)
        unfiltered.netty.RequestBinding$$anonfun$uri$1.apply(bindings.scala:70)
        scala.Option.foreach(Option.scala:236)
        unfiltered.netty.RequestBinding.uri(bindings.scala:70)
        unfiltered.request.Path$.unapply(paths.scala:4)
        unfiltered.netty.websockets.WebSocketPlanSpec$$anonfun$setup$1$$anonfun$apply$1.applyOrElse(spec.scala:11)
        unfiltered.netty.websockets.WebSocketPlanSpec$$anonfun$setup$1$$anonfun$apply$1.applyOrElse(spec.scala:10)
        scala.PartialFunction$OrElse.apply(PartialFunction.scala:162)
        unfiltered.netty.websockets.Plan$class.upgrade(plans.scala:70)
        unfiltered.netty.websockets.Plan$class.channelRead(plans.scala:52)
        unfiltered.netty.websockets.Planify$Planned.channelRead(plans.scala:172)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)
        io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:126)
        io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:507)
        io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:464)
        io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:378)
        io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350)
        io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
        java.lang.Thread.run(Thread.java:745)
Created at:
        io.netty.buffer.CompositeByteBuf.<init>(CompositeByteBuf.java:59)
        io.netty.buffer.Unpooled.compositeBuffer(Unpooled.java:355)
        io.netty.handler.codec.http.HttpObjectAggregator.decode(HttpObjectAggregator.java:147)
        io.netty.handler.codec.http.HttpObjectAggregator.decode(HttpObjectAggregator.java:52)
        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
        io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:341)
        io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:327)
        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)
        io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:126)
        io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:507)
        io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:464)
        io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:378)
        io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350)
        io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
        java.lang.Thread.run(Thread.java:745)
```