Should we use Java off-heap memory for inter-process communication?

976 views
Skip to first unread message

bob.tw...@gmail.com

unread,
Apr 28, 2015, 3:47:24 PM4/28/15
to mechanica...@googlegroups.com

I have been reading about Java off-heap memory through the Unsafe class and thinking about its usages. One that comes to mind is the old-school inter-process communication through shared memory. Can that be used in the Java land? How do two separate processes synchronize around a piece of off-heap shared memory? Is it worth the trouble or should we just use the network for outside-the-JVM communication?

Marshall Pierce

unread,
Apr 28, 2015, 3:54:20 PM4/28/15
to mechanica...@googlegroups.com
There are quite a few people on the list doing that sort of thing. Take a look at OpenHFT’s Chronicle family of projects, for instance: http://chronicle.software/

On Apr 28, 2015, at 12:47 PM, bob.tw...@gmail.com wrote:


I have been reading about Java off-heap memory through the Unsafe class and thinking about its usages. One that comes to mind is the old-school inter-process communication through shared memory. Can that be used in the Java land? How do two separate processes synchronize around a piece of off-heap shared memory? Is it worth the trouble or should we just use the network for outside-the-JVM communication?


--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jay Askren

unread,
Apr 28, 2015, 10:33:03 PM4/28/15
to mechanica...@googlegroups.com
Below is a blog post about this very subject.  I believe the author is a member of this group.

Sergey Zubarev

unread,
Apr 29, 2015, 3:00:37 AM4/29/15
to mechanica...@googlegroups.com
Shared memory for IPC in Java can be used even without Unsafe,
the only problem is that Java does not support process notification except sockets
(usually process shared semaphores and mutexes are available in native C API),
it significantly increase notification latency in a case if you are not ready to use busy wait strategy on consumer side.
Reply all
Reply to author
Forward
0 new messages