Fwd: two directbuffer have same address?

Matthias Ernst matthias at mernst.org
Fri Dec 21 08:28:23 UTC 2007

In Java, DirectByteBuffer#duplicate() will give you two buffers that
share the same address.
Also, from C, you can call NewDirectByteBuffer twice with the same address.

Thinking about it, both functions kind of look like they might
allocate memory for you but they don't!
Did you maybe fall into that trap?


On Dec 21, 2007 3:22 AM, zhang Jackie <jackieict at gmail.com> wrote:
> hi
>   I am using directbuffer and JNI to build a high speed network library. But
> When I use the directbuffer, I found some directbuffers have the same memory
> address(got by  GetDirectBufferAddress method). I think the memory
> allocation of directbuffer is not reasonable enough.
>  Can someoen give me some advice, Thanks

More information about the core-libs-dev mailing list