Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

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

未關閉 適合新手
#349 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 2 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
62/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
java
領域
testing

研究方向

從 TestReservationListener.java 中 testDirectReservationListener 附近開始,並在受影響的 macOS/JVM 設定上執行報告中顯示的 Maven 命令。檢查用於直接記憶體保留的 java.nio.Bits 欄位,並驗證測試在所參照的 CI 工作流程中也能通過。

由索引模型根據 Issue 內容生成。

描述

Hi Team,

Just compiling 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:

 


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

 

 

Test code:

 


/**
 * 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:

 


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

 

Consider: Current test on macOS finished ok on the ci workflows.

Reporter: David Dali Susanibar Arce / @davisusanibar

Note: This issue was originally created as ARROW-15834. Please see the migration documentation for further details.

主要語言
Java
星號
97
分支
158
平均合併
7 天 16 小時
30 天內合併 PR
32

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

apache/arrow-java 的其他 Issue

查看 apache/arrow-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。