{"record":{"id":"0855f7d42b291ff9","repo":"apache/cassandra","slug":"unable-to-start-gcinspector-currently-only-suppor","errorCode":null,"errorMessage":"Unable to start GCInspector (currently only supported on the Sun JVM)","messagePattern":"Unable to start GCInspector \\(currently only supported on the Sun JVM\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/service/CassandraDaemon.java","lineNumber":352,"sourceCode":"        {\n            loadRowAndKeyCacheAsync().get();\n        }\n        catch (Throwable t)\n        {\n            JVMStabilityInspector.inspectThrowable(t);\n            logger.warn(\"Error loading key or row cache\", t);\n        }\n\n        if (!SKIP_GC_INSPECTOR)\n        {\n            try\n            {\n                GCInspector.register();\n            }\n            catch (Throwable t)\n            {\n                JVMStabilityInspector.inspectThrowable(t);\n                logger.warn(\"Unable to start GCInspector (currently only supported on the Sun JVM)\");\n            }\n        }\n\n        // Replay any CommitLogSegments found on disk\n        PaxosState.initializeTrackers();\n\n        // replay the log if necessary\n        try\n        {\n            CommitLog.instance.recoverSegmentsOnDisk();\n            NodeId self = ClusterMetadata.current().myNodeId();\n            if (self != NodeId.UNREGISTERED)\n                AccordService.localStartup(self);\n        }\n        catch (IOException e)\n        {\n            throw new RuntimeException(e);\n        }","sourceCodeStart":334,"sourceCodeEnd":370,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/CassandraDaemon.java#L334-L370","documentation":"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.","triggerScenarios":"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.","commonSituations":"Running Cassandra on an unsupported JVM; running an incompatible JDK build where com.sun.management classes are unavailable or restricted; GC listeners already registered.","solutions":["Run Cassandra on a supported HotSpot/OpenJDK JVM (Java 11/17/21)","Inspect the Throwable via the JVMStabilityInspector log output to identify the exact registration failure","Note the node still starts; monitor GC via alternative means (GC logs, nodetool gcstats, external agents) if GCInspector cannot attach"],"exampleFix":"// before\ncassandra_env: JAVA_HOME=j9-sdk\n// after\ncassandra_env: JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64","handlingStrategy":"validation","validationCode":"// verify JVM support before startup\nString vm = System.getProperty(\"java.vm.name\");\nif (!vm.contains(\"HotSpot\") && !vm.contains(\"OpenJDK\"))\n    System.out.println(\"GCInspector not supported on: \" + vm);","typeGuard":null,"tryCatchPattern":"try {\n    GCInspector.register();\n} catch (Throwable t) {\n    JVMStabilityInspector.inspectThrowable(t);\n    logger.warn(\"Unable to start GCInspector (currently only supported on the Sun JVM)\");\n}","preventionTips":["Run Cassandra only on supported HotSpot-based JDKs","Enable JVM GC logging as a redundant monitoring channel","Verify com.sun.management classes are not stripped by custom JRE builds (jlink)"],"tags":["jvm","gc","monitoring"],"backgroundTag":"unsupported-platform","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}