Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in python bindings? #453

Open
Sola85 opened this issue Nov 14, 2023 · 0 comments
Open

Memory leak in python bindings? #453

Sola85 opened this issue Nov 14, 2023 · 0 comments

Comments

@Sola85
Copy link

Sola85 commented Nov 14, 2023

My application requires many independent wasm modules to be parsed and a function from them to be executed. While implementing this, I noticed my RAM usage continuouly growing. Here is a minimal example that quickly fills my RAM, adopted from the pywasm3 example:

import wasm3, base64
import gc

# WebAssembly binary
WASM = base64.b64decode("AGFzbQEAAAABBgFgAX4"
    "BfgMCAQAHBwEDZmliAAAKHwEdACAAQgJUBEAgAA"
    "8LIABCAn0QACAAQgF9EAB8Dws=")

for i in range(1000000):
    if i % 100 == 0: gc.collect()

    env = wasm3.Environment()
    rt  = env.new_runtime(2048)
    mod = env.parse_module(WASM)
    rt.load(mod)
    #wasm_fib = rt.find_function("fib")
    #result = wasm_fib(24)
    #print(result)  

Or did I miss a function to release/free the environment, runtime or module?

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

No branches or pull requests

1 participant