{"record":{"id":"915978ea390dfd17","repo":"pola-rs/polars","slug":"invalid-value-for-polars-override-total-memory-s","errorCode":null,"errorMessage":"invalid value for POLARS_OVERRIDE_TOTAL_MEMORY: {s}","messagePattern":"invalid value for POLARS_OVERRIDE_TOTAL_MEMORY: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-utils/src/sys.rs","lineNumber":22,"sourceCode":"\n/// Return the total system memory in bytes.\npub fn total_memory() -> u64 {\n    return *TOTAL_MEMORY;\n\n    static TOTAL_MEMORY: LazyLock<u64> = LazyLock::new(|| {\n        let mut sys = System::new();\n\n        sys.refresh_memory_specifics(MemoryRefreshKind::nothing().with_ram());\n\n        let mut v: u64 = match sys.cgroup_limits() {\n            Some(limits) => limits.total_memory,\n            None => sys.total_memory(),\n        };\n\n        if let Ok(s) = std::env::var(\"POLARS_OVERRIDE_TOTAL_MEMORY\") {\n            v = s\n                .parse::<u64>()\n                .unwrap_or_else(|_| panic!(\"invalid value for POLARS_OVERRIDE_TOTAL_MEMORY: {s}\"))\n        }\n\n        if polars_config::config().verbose() {\n            let gib = (v as f64) / (1024.0 * 1024.0 * 1024.0);\n            eprintln!(\"total memory: {gib:.3} GiB ({v} bytes)\")\n        }\n\n        v\n    });\n}\n\n/// Startup system is expensive, so we do it once\npub struct MemInfo {\n    sys: Mutex<System>,\n}\n\nimpl MemInfo {\n    /// This call is quite expensive, cache the results.","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/crates/polars-utils/src/sys.rs#L4-L40","documentation":"RuntimeError raised by the _CpuId checker's allocation step: the OS call to reserve executable memory (VirtualAlloc on Windows) returned a null pointer, so the CPUID opcode buffer could not be placed and the check cannot run. It indicates memory pressure or OS restrictions on executable allocations.","triggerScenarios":"POLARS_OVERRIDE_TOTAL_MEMORY holds an unparseable value.","commonSituations":"See trigger scenarios.","solutions":["Set POLARS_OVERRIDE_TOTAL_MEMORY to a valid byte size (integer, optionally with suffix) or unset it."],"exampleFix":"export POLARS_OVERRIDE_TOTAL_MEMORY=8589934592","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b5d73fd00236295624374b075d16b1fe6ec6df9","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}