From the java.nio.ByteBuffer javadoc (my emphasis added):
anonymous wrote :
| A direct byte buffer may be created by invoking the allocateDirect factory method of
this class. The buffers returned by this method typically have somewhat higher allocation
and deallocation costs than non-direct buffers. The contents of direct buffers may reside
outside of the normal garbage-collected heap, and so their impact upon the memory
footprint of an application might not be obvious. It is therefore recommended that direct
buffers be allocated primarily for large, long-lived buffers that are subject to the
underlying system's native I/O operations. In general it is best to allocate direct
buffers only when they yield a measureable gain in program performance.
|
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4214446#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...