Skip to content

Memory management #49

Answered by donalffons
sgenoud asked this question in Q&A
Discussion options

You must be logged in to vote

Hey!

JavaScript doesn't currently provide a simple way to hook into the garbage collection process. Therefore, there is no automatic freeing of memory, which you allocated via JS using const myObject = new openCascade.AnyClass(). I.e. you have to call myObject.delete() when you don't need this object any longer.

This memory is not immediately available again to be used by the browser and/or operating system:
When instantiating the WebAssembly module, a chunk of memory is created and assigned to it via a JavaScript ArrayBuffer. This ArrayBuffer has an initial size from which it can grow - however it can never shrink (I believe, this is a limitation of the WebAssembly spec). I.e. when you're

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sgenoud
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants