Skip to content

wasi build takes unexpectedly huge memory #4989

Closed

Description

@youknowone

Summary

Copied from Discord.

Very simple program requires 100MB+ memory

use rustpython_vm as vm;

fn main() -> vm::PyResult<()> {
    vm::Interpreter::without_stdlib(Default::default()).enter(|vm| {
        let scope = vm.new_scope_with_builtins();
        let source = r#"a = 1"#;
        let code_obj = vm
            .compile(source, vm::compiler::Mode::Exec, "<embedded>".to_owned())
            .map_err(|err| vm.new_syntax_error(&err, Some(source)))?;

        vm.run_code_obj(code_obj, scope)?;

        Ok(())
    })
}

Expected

Actual

./wasmi_cli /tmp/embedded-rust-python.wasm 
memory allocation of 79167488 bytes failed
Aborted

Python Documentation

Activity

  1. astrale-sharp commented on Jun 23, 2023

    @astrale-sharp

    I'm running into similar issues, did you compile with --release ?

  2. SeaRoll commented on Aug 9, 2025

    @SeaRoll

    running into same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions