wasi build takes unexpectedly huge memory · Issue #4989 · RustPython/RustPython · GitHub
Skip to content

wasi build takes unexpectedly huge memory #4989

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

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