[
https://issues.apache.org/jira/browse/DATASKETCHES-14?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17868204#comment-17868204
]
Lee Rhodes commented on DATASKETCHES-14:
----------------------------------------
The current releases of DS-Java and DS-memory are only valid for Java 8 and 11.
Although some functions of DS-memory will work with Java 17. The functions that
use Bits and some other JVM internals ( eg, creating off-heap memory) will
throw exceptions.
New releases for DS-Java and DS-memory for Java 17 are in the works and should
be released soon.
We also expect to have versions supporting Java 21 sometime later.
I also want to add that the upcoming version supporting Java 17 utilizes the
incubator version of Panama (FFM) that is available in 17. However, Panama
underwent significant changes from 17 to 21. And given our limited resources,
we cannot support non-LTS versions.
> NioBits throws an exception on Java 21.
> ---------------------------------------
>
> Key: DATASKETCHES-14
> URL: https://issues.apache.org/jira/browse/DATASKETCHES-14
> Project: Apache Datasketches
> Issue Type: Bug
> Reporter: Claude Warren
> Priority: Major
>
> When running on Java 21 the NioBits method throws an exception. This issue
> is noted in the NioBits code where indicates there are 2 methods that in
> Java 17 and later take a long and not an int.
>
> It issue is in this code block form NioBits:
>
> {{ static {}}
> {{ try {}}
> {{ isPageAligned = VirtualMachineMemory.getIsPageAligned();}}
> {{ maxDBBMemory = VirtualMachineMemory.getMaxDBBMemory();}}{{
> NIO_BITS_CLASS = Class.forName("java.nio.Bits");}}{{
> NIO_BITS_RESERVE_MEMORY_METHOD = NIO_BITS_CLASS}}
> {{ .getDeclaredMethod("reserveMemory", long.class, int.class);
> //JD16 requires (long, long)}}
> {{ NIO_BITS_RESERVE_MEMORY_METHOD.setAccessible(true);}}{{
> NIO_BITS_UNRESERVE_MEMORY_METHOD = NIO_BITS_CLASS}}
> {{ .getDeclaredMethod("unreserveMemory", long.class, int.class);
> //JD16 requires (long, long)}}
> {{ NIO_BITS_UNRESERVE_MEMORY_METHOD.setAccessible(true);}}{{ final
> Field countField =
> NIO_BITS_CLASS.getDeclaredField(NioBitsFields.COUNT_FIELD_NAME);}}
> {{ countField.setAccessible(true);}}
> {{ nioBitsCount = (AtomicLong) (countField.get(null));}}{{ final
> Field reservedMemoryField =
> NIO_BITS_CLASS.getDeclaredField(NioBitsFields.RESERVED_MEMORY_FIELD_NAME);}}
> {{ reservedMemoryField.setAccessible(true);}}
> {{ nioBitsReservedMemory = (AtomicLong)
> (reservedMemoryField.get(null));}}{{ final Field totalCapacityField =
> NIO_BITS_CLASS.getDeclaredField(NioBitsFields.TOTAL_CAPACITY_FIELD_NAME);}}
> {{ totalCapacityField.setAccessible(true);}}
> {{ nioBitsTotalCapacity = (AtomicLong)
> (totalCapacityField.get(null));}}{{ } catch (final ClassNotFoundException
> | NoSuchMethodException | IllegalAccessException}}
> {{ | IllegalArgumentException | SecurityException |
> NoSuchFieldException e) {}}
> {{ throw new RuntimeException("Could not acquire java.nio.Bits class: "
> + e.getClass());}}
> {{ }}}
> {{{} }{}}}{{{}{}}}
> {{if when NIO_BITS_RESERVE_MEMORY_METHOD and
> }}{{{}NIO_BITS_UNRESERVE_MEMORY_METHOD were discovered we instead looked for
> the function name without the parameters and accept a function definition
> that takes either (long, long) or (long, int) I think this might
> work.{}}}{{{}{}}}
> {{{}The current code base always passes an int as the second parameter so it
> should work with the (long, long) version of the method as well as the (long,
> int).{}}}{{{}{}}}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]