JDK-8349146 : [REDO] Implement a better allocator for downcalls
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang.foreign
  • Affected Version: repo-panama
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-01-31
  • Updated: 2025-05-13
  • Resolved: 2025-05-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25 b22Fixed
Related Reports
Cloners :  
Sub Tasks
JDK-8348909 :  
Description
Downcalls might need to perform some allocation. Currently this is done by using a fixed-size native arena.

But, the call to allocate this arena is relatively expensive compared to the overhead of a call, and it requires tricky arena size computations due to the need to align allocations, which also restricts the order in which allocations can occur.

We could instead implement a thread-local 'stack' allocator, which works like a dynamic sized arena, but with reset functionality to reset the allocated size back to a certain level. The underlying memory could stay around between calls, which could improve performance.
Comments
Changeset: 9f9e73d5 Branch: master Author: Per Minborg <pminborg@openjdk.org> Date: 2025-05-02 14:14:59 +0000 URL: https://git.openjdk.org/jdk/commit/9f9e73d5f9fcb5e926a2674c54cbbc92012b75f6
02-05-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/24829 Date: 2025-04-23 14:05:58 +0000
23-04-2025