title: How Java GC Does Direct Byte Buffer Clean Up, Because IBM Docs says, It Does.
body: <p>I assumed, I understood how Bytebuffer and DirectByteBuffer differs until i read a artical on IBM documentation, metioning :</p>
  
  <p>"Direct ByteBuffer objects clean up their native buffers automatically but can only do so as part of Java heap GC"</p>
  
  <p><a href="https://www.ibm.com/developerworks/library/j-nativememory-linux/" rel="nofollow">https://www.ibm.com/developerworks/library/j-nativememory-linux/</a></p>
  
  <p>Now I am not able to understand this line, as it says DirectByteBuffer does cleaning as part of Java heap GC.</p>
  
  <p>IFAIK, Java Heap GC only do clean up in java heap(where DirectByteBuffer is not allocated).
  It(GC) is no aware of native memory(where DirectByteBuffer is allocated).</p>
  
  <p>Please help me understand this line, or if there is gap in my understanding</p>