2

I got curious on the off-heap mechanism used by the openHFT project and am looking for the class file below (couldn't find anywhere in github) as defined by the source code here:

Class<? extends Memory> java9MemoryClass = Class
                    .forName("software.chronicle.enterprise.core.Java9Memory")
                    .asSubclass(Memory.class);

From the github repository: https://github.com/OpenHFT/Chronicle-Core/blob/master/src/main/java/net/openhft/chronicle/core/OS.java

My question is: Is this class open source? If yes, how does it work? Thanks.

1

2 Answers 2

3

This class is not available, and will be removed in future.

Our current approach to Java9 compatibility is to publish OpenHFT artifacts built to target language-level 1.8. Any incompatibilities in the Java runtime (such as class renames) will be dealt with by making your program require a Java9 module that will contain Java9-specific overrides.

In answer to your question of how the class works - Chronicle libraries will continue to utilise sun.misc.Unsafe when running on a version 9 JVM. It will be necessary to manually add exports to the command in order to allow this, e.g.:

--add-exports=java.unsupported/sun.misc=ALL-UNNAMED
Sign up to request clarification or add additional context in comments.

Comments

3

Java 9 support was separate as it was a moving target however we will be adding it as a sub module you can include if you need to run on java 9. This is still a work in progress.

1 Comment

Wow from the man himself!! Hats off to you and BalusC. Been a fan since the now decommissioned sun forums. (curse you, Oracle!) And thank you for stopping by to answer my question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.