Skip to content

Conversation

graalvmbot
Copy link
Collaborator

This adds detection and appropriate reporting if FFM API objects with associated native resources would be included in the image heap.

In particular, the disallowed objects are:

  • Non-null native memory segments (i.e. MemorySegment.isNative() is true)
  • Memory sessions (class MemorySegement.Scope) if they are alive and closable.

Non-closable sessions are still allowed because they will never have associated native resources as well as already closed sessions.
The resource list of any session object will be reset (to avoid making objects reachable by accident).

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label May 13, 2025
@graalvmbot graalvmbot closed this May 14, 2025
@graalvmbot graalvmbot deleted the fa/GR-64496/disallow_session_in_image_heap branch May 14, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants