Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
/ pmul Public archive

PMUL is a Java library that adds PMem programming features to Java’s foreign memory API in JDK 18

License

Notifications You must be signed in to change notification settings

pmem/pmul

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PROJECT NOT UNDER ACTIVE MANAGEMENT

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.

Persistent Memory Utility Libraries

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. 

OVERVIEW

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.

HOW TO BUILD & RUN

PREREQUISITES TO BUILD

The following are the prerequisites for building this Java library:

  1. Linux operating system
  2. Persistent Memory Development Kit (PMDK) v1.11 or newer
  3. Memkind v1.10
  4. Java 18
  5. Build tools - g++ compiler, CMake and Maven

PREREQUISITES TO RUN

This library assumes the availability of hardware persistent memory or emulated persistent memory. Instructions for creating emulated persistent memory are shown below.

EMULATING PERSISTENT MEMORY

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

STEPS TO BUILD AND RUN TESTS

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 sources
  • test - builds and runs tests
  • javadoc:javadoc - builds javadocs into target/site/apidocs
  • package - builds jar file into target directory

USING THIS LIBRARY IN EXISTING JAVA APPLICATIONS

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>

CONTRIBUTING

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.

Contacts

For more information on this library, contact Olasoji Denloye ([email protected]), or Steve Dohrmann ([email protected]).

About

PMUL is a Java library that adds PMem programming features to Java’s foreign memory API in JDK 18

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages