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.

toddlermenot
  • 1,588
  • 2
  • 17
  • 33

2 Answers2

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.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
  • 1
    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. – toddlermenot Sep 04 '17 at 17:54
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
Mark Price
  • 296
  • 1
  • 3