> I am working on a system where we continually jump between native code
> and java code. I have a place where I use NewDirectByteBuffer in the
[quoted text clipped - 11 lines]
>
> - Greg
Can you post a SSCCE?
What VM, platform & architecture are you using? Is your buffer being
allocated within the VM's process space, or by some other memory allocator?
How much smaller is the VM capacity than native capacity? If it's 8 bytes
or less, you may have an alignment issue in your pointer arithmetic.
If you are using view buffers around your ByteBuffer, you could still be
doing something wierd with alignments.
Also, inside the VM, buffer capacities are limited to 2^31-1. I think JNI
allows you to go bigger, as you may be able to do fancy things like create
a ByteBuffer up to 2^33-1 bytes and promote it to an IntBuffer before
handing it back to the VM. Though, I have no idea how well VMs support
those kinds of promotions, so you should probably be staying under 2 GB.
HTH,
-Zig