pola-rs/polars · error

POLARS_MEMORY_PREFETCH=madvise_willneed is not supported by

Error message

POLARS_MEMORY_PREFETCH=madvise_willneed is not supported by this system

What it means

Panic while parsing POLARS_MEMORY_PREFETCH: the value 'madvise_willneed' was requested, but the madvise(MADV_WILLNEED) code path is only compiled for unix targets and this system is not unix. Initialization of the prefetch strategy therefore panics with this message.

Source

Thrown at crates/polars-utils/src/mem.rs:137

                #[cfg(target_family = "unix")]
                {
                    madvise_sequential
                }
                #[cfg(not(target_family = "unix"))]
                {
                    panic!(
                        "POLARS_MEMORY_PREFETCH=madvise_sequential is not supported by this system"
                    );
                }
            },
            Some("madvise_willneed") => {
                #[cfg(target_family = "unix")]
                {
                    madvise_willneed
                }
                #[cfg(not(target_family = "unix"))]
                {
                    panic!(
                        "POLARS_MEMORY_PREFETCH=madvise_willneed is not supported by this system"
                    );
                }
            },
            Some("madvise_populate_read") => {
                #[cfg(target_os = "linux")]
                {
                    madvise_populate_read
                }
                #[cfg(not(target_os = "linux"))]
                {
                    panic!(
                        "POLARS_MEMORY_PREFETCH=madvise_populate_read is not supported by this system"
                    );
                }
            },
            Some("force_populate_read") => force_populate_read,
            Some(v) => panic!("invalid value for POLARS_MEMORY_PREFETCH: {v}"),

View on GitHub (pinned to 9b5d73fd00)

Solutions

  1. madvise_willneed is unsupported on this OS; unset POLARS_MEMORY_PREFETCH or choose another mode.

Example fix

unset POLARS_MEMORY_PREFETCH
Defensive patterns

Strategy: fallback

When it happens

Trigger: POLARS_MEMORY_PREFETCH=madvise_willneed on an unsupported platform.

Common situations: See trigger scenarios.


AI-assisted analysis of pola-rs/polars@9b5d73fd00 (2026-08-19). Data as JSON: /api/errors/9cd942d4b53856af. Report an issue: GitHub.