help
help copied to clipboard
doc: VM module, how to make VM out of scope and free resources (collected by GC)?
📗 API Reference Docs Problem
- Version: v14.0.0
- Platform: Linux localhost 4.14.67 nodejs/node#4 SMP PREEMPT Mon Jan 14 11:28:51 CST 2019 x86_64 Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz GenuineIntel GNU/Linux
- Subsystem: vm
Location
Section of the site where the content exists
Affected URL(s):
- https://nodejs.org/api/vm.html
Description
Concise explanation of the problem
I am developing a WASM app that utilizes node's http server and I plan to create a cluster/worker pool that destroys the cluster/worker when WASM memory was grown (is that the correct word?) out of the needed amount. This happen because WASM supports growing memory but not shrinking it, take a look at this issue. My application already utilizes a memory reset logic that works flawlessly, but still the total allocated memory was the last amount of used memory and it jumps especially when there's a huge incoming requests that get in.
A solution would be deleting all variable reference of the WASM Module instance, Memory instance, and etc and let node's GC collect unused resources but emscripten's emit so many global variable that refers to the instances and I think deleting them is complicated. So if we execute the emscripten's JS glue code and the WASM on a VM context, can we make it out of scope (make the GC collects it) since there's no way to destroy it as specified on the docs?
- [x] I would like to work on this issue and submit a pull request.
It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.