{"record":{"id":"cca614832b3f6ee4","repo":"risingwavelabs/risingwave","slug":"total-memory-bytes-is-larger-than-the-total-mem","errorCode":null,"errorMessage":"total_memory_bytes {} is larger than the total memory available bytes {} that can be acquired.","messagePattern":"total_memory_bytes (.+?) is larger than the total memory available bytes (.+?) that can be acquired\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/compute/src/lib.rs","lineNumber":186,"sourceCode":"impl risingwave_common::opts::Opts for ComputeNodeOpts {\n    fn name() -> &'static str {\n        \"compute\"\n    }\n\n    fn meta_addr(&self) -> MetaAddressStrategy {\n        self.meta_address.clone()\n    }\n}\n\nfn validate_opts(opts: &ComputeNodeOpts) {\n    let system_memory_available_bytes = system_memory_available_bytes();\n    if opts.total_memory_bytes > system_memory_available_bytes {\n        let error_msg = format!(\n            \"total_memory_bytes {} is larger than the total memory available bytes {} that can be acquired.\",\n            opts.total_memory_bytes, system_memory_available_bytes\n        );\n        tracing::error!(error_msg);\n        panic!(\"{}\", error_msg);\n    }\n    if opts.parallelism == 0 {\n        let error_msg = \"parallelism should not be zero\";\n        tracing::error!(error_msg);\n        panic!(\"{}\", error_msg);\n    }\n    let total_cpu_available = total_cpu_available().ceil() as usize;\n    if opts.parallelism > total_cpu_available {\n        let error_msg = format!(\n            \"parallelism {} is larger than the total cpu available {} that can be acquired.\",\n            opts.parallelism, total_cpu_available\n        );\n        tracing::warn!(error_msg);\n    }\n}\n\nuse crate::server::compute_node_serve;\n","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/compute/src/lib.rs#L168-L204","documentation":"validate_opts in the compute node's startup path panics when opts.total_memory_bytes exceeds the total memory available on the machine (system_memory_available_bytes). RisingWave refuses to start a compute node configured to claim more memory than the host can provide, since memory accounting and reservation would be invalid.","triggerScenarios":"Setting total_memory_bytes (e.g. via --total-memory-bytes or config) higher than physical/available system RAM; running in a container whose cgroup limit is below the configured value; misconfigured risedev profiles or k8s resource limits.","commonSituations":"Kubernetes deployments where the pod memory limit was lowered but the RisingWave flag was not; copying config from a bigger machine to a smaller one; overcommitting a shared host.","solutions":["Lower total_memory_bytes in the compute node config/CLI flag to a value at or below the machine's available memory.","Raise the host/container memory limit (e.g. k8s resources.limits.memory) to match the configured total_memory_bytes.","Remove the explicit total_memory_bytes flag so RisingWave auto-detects available memory.","Use cgroup/OS tools (free, /sys/fs/cgroup) to confirm actual available memory before configuring."],"exampleFix":"// before\n./rise compute-node --total-memory-bytes 8589934592  # 8GB on a 4GB host\n// after\n./rise compute-node --total-memory-bytes 3221225472  # 3GB, below the 4GB limit","handlingStrategy":"validation","validationCode":"// Before launching the compute node, verify configured memory fits the host\ntotal_memory_bytes = 3221225472\navailable = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_AVPHYS_PAGES')\nassert total_memory_bytes <= available, 'total_memory_bytes exceeds available memory'","typeGuard":null,"tryCatchPattern":"// Node panics at startup; wrap process launch and surface the panic message\nmatch result {\n    Err(e) if e.to_string().contains(\"total_memory_bytes\") =>\n        eprintln!(\"fix total_memory_bytes: must be <= available system memory\"),\n    Err(e) => return Err(e),\n    Ok(v) => Ok(v),\n}","preventionTips":["Let RisingWave auto-detect memory instead of hardcoding total_memory_bytes.","Keep the flag in sync with k8s resource limits; use downward API or env templating.","Check available memory with free/cgroup limits before deploying to a new host."],"tags":["rust","config","memory","startup","compute-node"],"backgroundTag":"invalid-config-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}