oracle/graal · error

Unsupported option: AutomaticReferenceHandling

Error message

Unsupported option: AutomaticReferenceHandling

What it means

Error "Unsupported option: AutomaticReferenceHandling" thrown in oracle/graal.

Source

Thrown at espresso/src/com.oracle.truffle.espresso.mokapot/src/mokapot.c:2158

        return "-Xmx128m";
    } else {
        return option_str;
    }
}

static jint process_isolate_args(JavaVMInitArgs *initArgs, int *isolate_argc, char ***isolate_argv, int *n_ignored_indices, int **ignored_indices) {
    // Pull out arguments that need to be handled by isolate creation in SVM and can't be set correctly later
    // Mark those as ignored so that Espresso_CreateJavaVM knows not to act on them
    // but still uses them to compose the jvm args as seen by management APIs

    jboolean auto_adjust_heap_size = JNI_TRUE;
    for (int i = 0; i < initArgs->nOptions; i++) {
        const JavaVMOption *option = initArgs->options + i;
        char *optionString = NULL;
        if (option_starts_with("-XX:", option)) {
            if (option->optionString[4] == '-' || option->optionString[4] == '+') {
                if (strcmp("AutomaticReferenceHandling", option->optionString + 5) == 0) {
                    fprintf(stderr, "Unsupported option: AutomaticReferenceHandling" OS_NEWLINE_STR);
                    return JNI_ERR;
                } else if (strcmp("AutoAdjustHeapSize", option->optionString + 5) == 0) {
                    auto_adjust_heap_size = option->optionString[4] == '+' ? JNI_TRUE : JNI_FALSE;
                } else if (probe_option_type(option->optionString + 5) == OPTION_BOOLEAN) {
                    optionString = option->optionString;
                } else {
                    continue;
                }
            } else if (option_starts_with("-XX:MaxHeapSize=", option)) {
                optionString = maybe_adjust_max_heap_size(option->optionString, strlen("-XX:MaxHeapSize="), auto_adjust_heap_size);
            } else if (probe_option_type(option->optionString + 4) == OPTION_STRING) {
                optionString = option->optionString;
            } else {
                continue;
            }
        } else if (option_starts_with("-Xms", option) || option_starts_with("-Xmn", option)) {
            optionString = option->optionString;
        } else if (option_starts_with("-Xmx", option)) {

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Fix the condition reported by the error: Unsupported option: AutomaticReferenceHandling
  2. Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call.

Example fix

Validate inputs and environment so that the failing condition does not occur: Unsupported option: AutomaticReferenceHandling

When it happens

Trigger: Thrown at espresso/src/com.oracle.truffle.espresso.mokapot/src/mokapot.c:2158 when the library encounters an invalid state.

Common situations: Occurs when a caller violates the contract guarded by this check: Unsupported option: AutomaticReferenceHandling


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/35e40ee2ff05f4d4. Report an issue: GitHub.