bytecodealliance / wasmtime

A fast and secure runtime for WebAssembly
https://wasmtime.dev/
Apache License 2.0
15.36k stars 1.3k forks source link

Command modules are easy to leak memory with #1913

Open alexcrichton opened 4 years ago

alexcrichton commented 4 years ago

The implementation of "command" modules in Linker will create a new Instance each time an export is invoked. This works well implementation-wise but it's also easy to leak memory and resources unintentionally. No Instance is actually deallocated until the Store is dropped, which means that commands are a vector for repeatedly creating instances by accident without ever actually deleting them.

I'm not really sure what the best way to handle this would be, but we should probably either document this or look into a fix!

cc @sunfishcode

github-actions[bot] commented 4 years ago

Subscribe to Label Action

cc @peterhuene

This issue or pull request has been labeled: "wasmtime:api" Thus the following users have been cc'd because of the following labels: * peterhuene: wasmtime:api To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file. [Learn more.](https://github.com/bytecodealliance/subscribe-to-label-action)