=================
This Memory Project was initially developed to enable the DataSketches Java Project to manage off-heap data structures efficiently. The first version was developed as an internal project at Yahoo in 2014 using Java 8 and released to open source in 2015. This Memory Project is general purpose, has no external runtime dependencies and can be used in any application that needs to manage data structures on or off the Java heap.
To make this useful, this project also provided:
Providing these capabilities without sacrificing performance required leveraging internal JVM classes such as Unsafe, FileChannelImpl, DirectBuffer, MappedByteBuffer internals and sun.nio.ch.
However, starting with Java 11, Oracle started restricting access to a many JVM internal classes. With Java 17 the internals of FileChannelImpl and MappedByteBuffer were hidden or relocated. This blocked the ability to provide direct access to file-mapped memory.
Meanwhile, the Java Panama project, which had the potential to provide all the above capabilities as part of the Java language, became available as the Foreign Function and Memory (FFM) API in the form of “Incubation” code in Java 17 and as “Preview” code in Java 21. In Java 25 many of the methods of Unsafe have been marked “Deprecated”. They are still available, but will cause deprecation warnings especially at compile time.
Unfortunately, the DataSketches Memory Project releases 4.X, 5.X and 6.X for Java 17 and 21 were developed using the Incubation and Preview versions of FFM not realizing that Incubation and Preview codes are only available until the next java version is released, after which they are no longer available.
The actual LTS release of FFM did not occur until Java 25 was released on September 16, 2025. Since Java 17 was released on September 14, 2021, there is a gap of 4 years where Oracle had blocked access to internals of the JVM without providing a LTS release API with comparable capabilities. This means that for the LTS Java versions 17, 21, and 25, the DataSketches Memory Project can not provide access to file-mapped memory. Nonetheless, it is still possible to provide the following capabilities:
The objective of this 7.X release of the Memory Project is to provide Capability Set A with Java 11 and Capability Set B for Java versions 17 and 21, for users that are still dependent on the these older LTS releases. Java 25 was added for certain systems that required a single jar across Java versions 17, 21, and 25.
In addition, with this release the build code has been completely refactored:
Because the FFM capabilities built into Java 25 (released September, 2025) are a major superset of this Memory Project's capabilities (open sourced in 2015), all of these capabilities are now available directly from the Java Language. There is little reason to continue to provide new releases of this project. Alas, this project must come to an end. Any further releases will only be for bug fixes. Nonetheless, we were able to provide these fast, low-level, off-heap memory capabilities for 10 years before the Java language finally provided it.
Although the ByteBuffer provides similar capabilities, it has some severe limitations.
Please download datasketches-memory 3.X from the website downloads page and refer to the README.md there. The 3.X set of releases will be the last that support Java 8.
Deprecated with the 7.X releases.
This artifact is compiled with Java 11 and can only be used with Java 11
This artifact is compiled with Java 17 and can be used with Java 17, 21, and 25+. There is no guarantee that this code base will continue to work beyond Java 25. Caveat Emptor.
In this environment, the user is using the Jars from Maven Central as a library dependency and not attempting to build this Memory Project from the source code.
datasketches-memory-java11You will need to add these java modular arguments to your JVM:
datasketches-memory-java17_25You will need to add these java modular arguments to your JVM:
In this environment the developer needs to build the Memory component from source and run the Memory Component tests.
~/.m2/toolchains.xml and configured with at least JDK versions 11, 17, 21, and 25.gpg-agent running in your terminal.gpg-agent.conf is configured with a long cache Time-To-Live (TTL), or signing might fail with a no pinentry error during longer builds.pom.xml files along with the toolchains.xml determine the JDK version used to compile the projects.NOTES:
TESTS:
mvn clean test/target/test-outputmvn clean javadoc:javadoc -DskipTests=true/target/site/apidocs/mvn clean install -DskipTests=true -Pnexus-jars-Pnexus-jars is required to generage the GPG signatures.This will create the following sets of Jars and POMs, with associated GPG .asc signatures (not listed here) in the folder ~/.m2/repository/org/apache/datasketches/ and under
datasketches-memory-java11/X.Y.Z/:
datasketches-memory-java17_25/X.Y.Z/:
mvn clean deploy -DskipTests=true -Pnexus-jarsThis will upload the two sets of jars above as two distinct artifact IDs but in one upload batch. You must log into Nexus / Staging Repositories and close the upload until you are ready to actually release.
Please visit the main DataSketches website for more information about the DataSketches Library and all the different languages it is available in.
If you are interested in making contributions to this Memory Project or to any of the other DataSketches Projects please visit our Community page.
- LR