title: Where is the memory of direct buffer allocated by netty, kernel space or user space?
body: <p>I write a simple http client using netty 4. As far as I know, if I use HeapBuffer, when I get the ByteBuffer in the ChannelInboundHandler</p>
  
  <pre><code>@Override
  public void channelRead(ChannelHandlerContext ctx, final ByteBuf msg) throws Exception {
      // do nothing with the msg
  }
  </code></pre>
  
  <p>The bytes from the website should be a process like (even if I don't call ByteBuf.read)</p>
  
  <pre><code>socket -&gt; kernel space -&gt; user space
  </code></pre>
  
  <p>The bytes should have been in the java heap, right?</p>
  
  <p>I want to know if I use DirectBuffer, when the "channelRead" triggered, where are the bytes form the website if I don't call ByteBuf.read, are they in the kernel space, or in the user space? Is it one less memory-copy than I use HeapBuffer (because it won't copy to the user space)?</p>