Memory-Access Methods in sun.misc.Unsafe are deprecated for removal

Open
#511 4 comments 1 reaction 1 assignee View on GitHub

@jbonofre is already working on this.

Since Feb 5, 2025.

Assessment

This issue has not been assessed yet.

Description

Type: bug
Describe the bug, including details regarding any error messages, version, and platform.

In JDK 24, JEP 498: Warn upon Use of Memory-Access Methods in sun.misc.Unsafe deprecates several memory access methods in sun.misc.Unsafe for removal.

These methods are used by arrow here https://github.com/laurentgo/arrow/blob/fa8ebdebd1109217a6ac1ae2f173e1ab9d400d82/java/memory/memory-core/src/main/java/org/apache/arrow/memory/util/MemoryUtil.java#L30

https://github.com/apache/arrow/issues/43479 is related, it refactored uses of these APIs to consolidate the references in MemoryUtil, and mentions that change is

a first step towards switching from sun.misc.Unsafe to safer memory access methods (which may become a requirement at some point as discussed in JEP 471 )

Are there plans to switch to safer memory access methods?

Component(s)

Java

Dominant language
Java
Stars
95
Forks
154
Avg merge
2d 10h
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/arrow-java

All issues in apache/arrow-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.