This project will no longer be maintained by Intel.
This project has been identified as having known security escapes.
Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.
Intel no longer accepts patches to this project.
OpenJDK now supports direct access to off-heap memory via the jdk.incubator.foreign
package. While this package offers basic support for programming with persistent memory,
PMUL implements additional features useful for programming with persistent memory.
The Persistent Memory Utility Libraries (PMUL) provide access to off-heap persistent memory from Java.
PMUL offers heaps of allocatable persistent memory, which can be directly used with the jdk.incubator.foreign
API. PMUL also offers optional, fail-safe transactions useful in implementing strong data consistency policies. Data stored in PMUL heaps can persist beyond the life of a JVM instance, i.e. across application or system restarts.
PMUL uses the Persistent Memory Development Kit (PMDK). For more information on PMDK, please visit http://pmem.io and https://github.com/pmem/pmdk.
The following are the prerequisites for building this Java library:
- Linux operating system
- Persistent Memory Development Kit (PMDK) v1.11 or newer
- Memkind v1.10
- Java 18
- Build tools -
g++
compiler,CMake
andMaven
This library assumes the availability of hardware persistent memory or emulated persistent memory. Instructions for creating emulated persistent memory are shown below.
The preferred way is to create an in-memory DAX file system. This requires Linux kernel 4.2 or greater. Please follow the steps at:
http://pmem.io/2016/02/22/pm-emulation.html
Alternatively, for use with older kernels, create a tmpfs partition as follows (as root):
$ mount -t tmpfs -o size=4G tmpfs /mnt/mem # creates a 4GB tmpfs partition
$ chmod -R a+rw /mnt/mem # enables read/write permissions to all users
Once all the prerequisites have been satisfied:
$ git clone https://github.com/pmem/pmul.git
$ cd pmul
$ EXPORT LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<path>/pmul/target/cppbuild:<path to pmdk libs>:<path to memkind>
$ mvn test -Dtest.heap.path=<path to persistent memory mount point>
Available Maven commands include:
compile
- builds sourcestest
- builds and runs testsjavadoc:javadoc
- builds javadocs intotarget/site/apidocs
package
- builds jar file intotarget
directory
To use this library in your Java application, build the PMUL jar and specify its location in the module path argument. Also ensure that environment variable LD_LIBRARY_PATH includes paths to the required native libraries. For example:
$ EXPORT LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<path>/pmul/target/cppbuild:<path to pmdk libs>:<path to memkind>
$ mvn package
$ javac --module-path <path>/target/pmul-<version>.jar --add-modules jdk.incubator.foreign,com.intel.pmem.pmul <source>
$ java --module-path <path>/target/pmul-<version>.jar --add-modules jdk.incubator.foreign,com.intel.pmem.pmul --enable-native-access com.intel.pmem.pmul,ALL-UNNAMED --add-reads=com.intel.pmem.pmul=java.compiler <class>
Alternatively, use PMUL's target/classes
directory as the module path. For example:
$ EXPORT LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<path>/pmul/target/cppbuild:<path to pmdk libs>:<path to memkind>
$ mvn compile
$ javac --module-path <path>/target/classes --add-modules jdk.incubator.foreign,com.intel.pmem.pmul <source>
$ java ---module-path <path>/target/classes --add-modules jdk.incubator.foreign,com.intel.pmem.pmul --enable-native-access com.intel.pmem.pmul,ALL-UNNAMED --add-reads=com.intel.pmem.pmul=java.compiler<class>
Thanks for your interest! Please see the CONTRIBUTING.md document for information on how to contribute.
We would love to hear your comments and suggestions via https://github.com/pmem/pmul/issues.
For more information on this library, contact Olasoji Denloye ([email protected]), or Steve Dohrmann ([email protected]).