Skip to content

[Spike] Java 26: Removal of sun.misc.Unsafe - Caffeine cache will cease to work #2731

@jtduffy

Description

@jtduffy

Description

Java 26 is completely dropping support for the sun.misc.Unsafe class. The version of Caffeine cache that the agent bundles utilizes this class internally, which means without any changes, the agent will cease to work when running under a Java 26 runtime. The agent is unable to upgrade to a version of Caffeine that doesn't utilize sun.misc.Unsafe, since the fixed version only supports Java 9+.

A few options, in no particular order:

  • Replace Caffeine with another cache library
  • Multi-version agent jar (one for Java 8, one for Java 9+)
  • Shadow both versions of Caffeine in the agent; have a multi-release jar with a CollectionsFactory that picks the proper underlying Caffeine impl at runtime
  • Drop support for Java 8
  • Two forks of the agent, one for Java 8, one for Java 9+

Relates to #2730

Removal of Unsafe

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Code Complete/Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions