-
Notifications
You must be signed in to change notification settings - Fork 824
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 when generating Instance #3485
Comments
I have the same issue (taking the example given here: https://docs.rs/wasmer/latest/wasmer/#usage). Valgrind shows the following output:
|
Shouldn't this wasmer/lib/vm/src/instance/allocator.rs Line 194 in 0785137
be done, after writing the instance at the new place? Or am I missing how this works? |
Maybe, I'm not sure, because drop should not be called while we are calling write_instance on the InstanceAllocator, so it should not matter? I would think once we call |
Yeah I read the code wrong, you're right! |
Hmm indeed, I can find a Drop/dealloc implementation for I'll need to checkout and see if the |
So, using Valgrind, I see some memory leak with a minimal program. Something seems off with the Instance. I'll dig further. |
Created a branch with a potential fix. |
In my case I can still see memory leaking, though it looks as if it is indeed less than before :) |
This issue is also referenced in https://oss-fuzz.com/testcase-detail/5021130350264320 |
@ubamrein I have update the branch, |
Branch has been merged to master. I guess this ticket can be closed now right? |
Describe the bug
I'm currently using wasmer to play arround with wasm-edgecomputing. For every request, I use the serialized bytes of a module to deserialize it, and execute the corresponding wasm file (I also tried the non serialized method before, but the memory leak was even worse).
The following code is the minimal amount of code I need, to reproduce a memory-leak:
Steps to reproduce
Execute the above code within a loop, as for example like this (note I use compressed wasm files but that should not matter in this context as it is only done once):
Expected behavior
There should be no memory-leak, as no wasm code gets executed (possible leaks there) and there is literally nothing, except for the wasm file, being loaded.
Actual behavior
You can verify that the memory usage grows and grows until it is OOM killed (which in the example above can take some time :)).
The text was updated successfully, but these errors were encountered: