Skip to content

[GR-71128][Native Image] Setting options at Isolate creation (like -Xmx) from a shared library is API private #12418

@fidothe

Description

@fidothe

Describe the Issue

With a native-image generated shared library, setting options at isolate creation (with graal_create_isolate()) requires creating a graal_create_isolate_params_t struct, but that struct is opaque and the only documentation reference I can find mentions the fields we'd need to set, but also says they're private.

It would be great if there was a non-private way to create a graal_create_isolate_params_t in order to pass runtime configuration option like -XX:-Xmx... in.

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

openjdk 25.0.1 2025-10-21
OpenJDK Runtime Environment GraalVM CE 25.0.1+8.1 (build 25.0.1+8-jvmci-b01)
OpenJDK 64-Bit Server VM GraalVM CE 25.0.1+8.1 (build 25.0.1+8-jvmci-b01, mixed mode, sharing)

Troubleshooting Confirmation

Additional Context

Here's the relevant section of the generated graal_isolate.h:

/* Parameters for the creation of a new isolate. */
enum { __graal_create_isolate_params_version = 4 };
struct __graal_create_isolate_params_t {
    int version;                                /* Version of this struct */

    /* Fields introduced in version 1 */
    __graal_uword  reserved_address_space_size; /* Size of address space to reserve */

    /* Fields introduced in version 2 */
    const char    *auxiliary_image_path;                /* Path to an auxiliary image to load. */
    __graal_uword  auxiliary_image_reserved_space_size; /* Reserved bytes for loading an auxiliary image. */

    /* Fields introduced in version 3 */
    int            _reserved_1;                 /* Internal usage, do not use. */
    char         **_reserved_2;                 /* Internal usage, do not use. */
    int            pkey;                        /* Isolate protection key or domain. */

    /* Fields introduced in version 4 */
    char           _reserved_3;                 /* Internal usage, do not use. */
    char           _reserved_4;                 /* Internal usage, do not use. */
};
typedef struct __graal_create_isolate_params_t graal_create_isolate_params_t;

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions