datasketches-memory-java11/src/main/java/org/apache/datasketches/memory/internal/VirtualMachineMemory.java [37:47]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  static {
    try {
      VM_CLASS = Class.forName("jdk.internal.misc.VM");
      VM_IS_DIRECT_MEMORY_PAGE_ALIGNED_METHOD = VM_CLASS.getDeclaredMethod("isDirectMemoryPageAligned");
      VM_IS_DIRECT_MEMORY_PAGE_ALIGNED_METHOD.setAccessible(true);
      isPageAligned = (boolean) VM_IS_DIRECT_MEMORY_PAGE_ALIGNED_METHOD.invoke(null); //static method
    } catch (final ClassNotFoundException | NoSuchMethodException |  IllegalAccessException
        | IllegalArgumentException | InvocationTargetException | SecurityException e) {
      throw new RuntimeException("Could not acquire jdk.internal.misc.VM: " + e.getClass());
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/VirtualMachineMemory.java [37:47]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  static {
    try {
      VM_CLASS = Class.forName("sun.misc.VM");
      VM_IS_DIRECT_MEMORY_PAGE_ALIGNED_METHOD = VM_CLASS.getDeclaredMethod("isDirectMemoryPageAligned");
      VM_IS_DIRECT_MEMORY_PAGE_ALIGNED_METHOD.setAccessible(true);
      isPageAligned = (boolean) VM_IS_DIRECT_MEMORY_PAGE_ALIGNED_METHOD.invoke(null); // static method
    } catch (final ClassNotFoundException | NoSuchMethodException |  IllegalAccessException
        | IllegalArgumentException | InvocationTargetException | SecurityException e) {
      throw new RuntimeException("Could not acquire sun.misc.VM class: " + e.getClass());
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



