David Dali Susanibar Arce created ARROW-15834:
-------------------------------------------------

             Summary: [JAVA][Test][Dataset]: Problem to get current reservation 
of JVM direct memory on macOS Big Sur
                 Key: ARROW-15834
                 URL: https://issues.apache.org/jira/browse/ARROW-15834
             Project: Apache Arrow
          Issue Type: Test
          Components: Java
    Affects Versions: 7.0.0
            Reporter: David Dali Susanibar Arce


Hi Team,

Just compiling [java dataset 
|https://github.com/apache/arrow/tree/master/java/dataset]module it compile 
without problems but the test related to  get current reservation of JVM direct 
memory is failing on my local machine macOS Big Sur 11.5.2.

Command line:

 
{code:java}
mvn -Darrow.cpp.build.dir=../java-dist/lib clean install {code}
 

 

Test code:

 
{code:java}
/**
 * Get current reservation of jVM direct memory. Visible for testing.
 */
@VisibleForTesting
public long getCurrentDirectMemReservation() {
  try {
    final Class<?> classBits = Class.forName("java.nio.Bits");
     final Field f = classBits.getDeclaredField("reservedMemory");
    f.setAccessible(true);
    return ((AtomicLong) f.get(null)).get();
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
} {code}
 

 

Error message:

 
{code:java}
[ERROR] testDirectReservationListener  Time elapsed: 0.028 s  <<< ERROR!
java.lang.RuntimeException: java.lang.NoSuchFieldException: reservedMemory
        at 
org.apache.arrow.dataset.jni.TestReservationListener.testDirectReservationListener(TestReservationListener.java:50)
 {code}
 

 

If I changed from classBits.getDeclaredField("reservedMemory") to 

classBits.getDeclaredField("RESERVED_MEMORY") all the test finished without 
problems. Seeing this way to obtain reserved memory on 
[Jvm.java|https://github.com/OpenHFT/Chronicle-Core/blob/ea/src/main/java/net/openhft/chronicle/core/Jvm.java#L144].

 

Consider: Current test on macOS finished ok on the [ci 
workflows|https://github.com/ursacomputing/crossbow/runs/4987946390].



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to