apache/cassandra · warning

Unable to start GCInspector (currently only supported on…

Error message

Unable to start GCInspector (currently only supported on the Sun JVM)

What it means

Warning logged when GCInspector.register() fails during daemon setup. GCInspector hooks GarbageCollectionNotificationInfo-based GC monitoring and is only implemented for the Sun/HotSpot JVM (and matching build variants); on other JVMs or if the platform MXBean lookup fails, GC statistics will not be collected.

Solutions

  1. Run Cassandra on a supported HotSpot/OpenJDK JVM (Java 11/17/21)
  2. Inspect the Throwable via the JVMStabilityInspector log output to identify the exact registration failure
  3. Note the node still starts; monitor GC via alternative means (GC logs, nodetool gcstats, external agents) if GCInspector cannot attach

Example fix

// before
cassandra_env: JAVA_HOME=j9-sdk
// after
cassandra_env: JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
Defensive patterns

Strategy: validation

Validate before calling

// verify JVM support before startup
String vm = System.getProperty("java.vm.name");
if (!vm.contains("HotSpot") && !vm.contains("OpenJDK"))
    System.out.println("GCInspector not supported on: " + vm);

Try / catch

try {
    GCInspector.register();
} catch (Throwable t) {
    JVMStabilityInspector.inspectThrowable(t);
    logger.warn("Unable to start GCInspector (currently only supported on the Sun JVM)");
}

Prevention

When it happens

Trigger: setup() runs on a non-Sun JVM (e.g. IBM J9, OpenJ9, older JRockit) or the platform GarbageCollectorMXBean/notification infrastructure throws while registering listeners, e.g. missing com.sun.management APIs.

Common situations: Running Cassandra on an unsupported JVM; running an incompatible JDK build where com.sun.management classes are unavailable or restricted; GC listeners already registered.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/0855f7d42b291ff9. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/service/CassandraDaemon.java:352

        {
            loadRowAndKeyCacheAsync().get();
        }
        catch (Throwable t)
        {
            JVMStabilityInspector.inspectThrowable(t);
            logger.warn("Error loading key or row cache", t);
        }

        if (!SKIP_GC_INSPECTOR)
        {
            try
            {
                GCInspector.register();
            }
            catch (Throwable t)
            {
                JVMStabilityInspector.inspectThrowable(t);
                logger.warn("Unable to start GCInspector (currently only supported on the Sun JVM)");
            }
        }

        // Replay any CommitLogSegments found on disk
        PaxosState.initializeTrackers();

        // replay the log if necessary
        try
        {
            CommitLog.instance.recoverSegmentsOnDisk();
            NodeId self = ClusterMetadata.current().myNodeId();
            if (self != NodeId.UNREGISTERED)
                AccordService.localStartup(self);
        }
        catch (IOException e)
        {
            throw new RuntimeException(e);
        }

View on GitHub (pinned to 88fd0f6a0e)