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 查看

还没有人认领这个 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
星标
95
派生
154
平均合并
2 天 10 小时
30 天内合并 PR
11

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/arrow-java 的其他 Issue

查看 apache/arrow-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。