pub fn spawn_with_memory_limit(cmd: &mut Command) -> Result<Child>Expand description
Spawns a command with a virtual memory limit via setrlimit(RLIMIT_AS).
On Linux, applies the limit in a pre_exec hook before the child process
starts. On non-Linux platforms, falls back to an unlimited spawn.
The limit is read from SQLITE_GRAPHRAG_SUBPROCESS_MEMORY_LIMIT_MB
(default: 4096 MiB).