apache / apache/arrow-java

[Java] Problem to get current reservation of JVM direct memory on macOS Big Sur

Đang mở Phù hợp với người mới
#349 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
94
Fork
152
Merge trung bình
3 ngày 16 giờ
Pull request đã merge (30 ngày)
11

Mô tả

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:

 
```java

mvn -Darrow.cpp.build.dir=../java-dist/lib clean install
```
 

 

Test 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);
}
}
```
 

 

Error message:

 
```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)

```
 

 

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).

**Reporter**: [David Dali Susanibar Arce](https://issues.apache.org/jira/browse/ARROW-15834) / @davisusanibar

**Note**: *This issue was originally created as [ARROW-15834](https://issues.apache.org/jira/browse/ARROW-15834). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with TestReservationListener.java around testDirectReservationListener and run the Maven command shown in the report on the affected macOS/JVM setup. Inspect the java.nio.Bits field used for the direct-memory reservation and verify the test also passes in the referenced CI workflow.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
testing
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
62/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.