Shared memory between C++ and Java processes <p>My aim is to pass data from a C++ process to a Java process and then to receive a result back.</p> <p>I have achieved this via a named pipe but I would prefer to share the data rather than passing or copying it, assuming the access would be faster.</p> <p>Initially, I thought of creating a shared segment in C++ that I could write to and read with Java, but I'm not sure if this is possible via JNI, let alone safe.</p> <p>I believe it's possible in Java to allocate the memory using ByteBuffer.allocateDirect and then use GetDirectBufferAddress to access the address in C++, but if I'm correct this is for native calls within JNI and I can't get this address in my C++ process?</p> <p>Lost.</p> <p>Many thanks in advance.</p>