Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using non persisted memory mapped file in Java

user580550Apr 4 2017 — edited Apr 12 2017

Ask Question

Hi All

I want to implement memory mapped file concept as a shared memory to share data between two processes running in my windows system. One in Java and another in native (C# layer).

Both are running processes and hence i want to use non persisted mechanism for memory mapped files instead of persisted file option (because a file poses a security threat ).

Java File Channels http://docs.oracle.com/javase/6/docs/api/java/nio/channels/FileChannel.html#map(java.nio.channels.FileChannel.MapMode, long, long) has an option to map to an existing file.

C# has option to map both a persisted file and a simple alias named map for non persisted file. Please check here https://msdn.microsoft.com/en-us/library/dd997372(v=vs.110).aspx

So i am looking as how i can create a mapping for non persisted mechanism in Java.

Best Regards,

Saurav

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 10 2017
Added on Apr 4 2017
1 comment
670 views