You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The advice to avoid a Timeout from being cancelled when it goes out of scope is to call its forget method.
I wondered how that doesn't leak memory in the Wasm module, but tracing through to the wasm-bindgen closure module, the call to forget which calls into_js_value and the doc for into_js_value says this does leak memory, and can overwhelm the page if done too frequently.
Is it correct that this is referring to memory consumed within the Wasm module's memory (so replacing the Wasm instance with a new version might be an option for some), or is this referring to JavaScript memory associated with the document?
And projects are fine leaking memory by using forget on their objects that hold closures, or they generally find ways to code around the issue by not using forget and not letting their instances go out of scope?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The advice to avoid a
Timeout
from being cancelled when it goes out of scope is to call its forget method.I wondered how that doesn't leak memory in the Wasm module, but tracing through to the wasm-bindgen closure module, the call to forget which calls into_js_value and the doc for into_js_value says this does leak memory, and can overwhelm the page if done too frequently.
Is it correct that this is referring to memory consumed within the Wasm module's memory (so replacing the Wasm instance with a new version might be an option for some), or is this referring to JavaScript memory associated with the
document
?And projects are fine leaking memory by using
forget
on their objects that hold closures, or they generally find ways to code around the issue by not usingforget
and not letting their instances go out of scope?Beta Was this translation helpful? Give feedback.
All reactions