Skip to content
This repository was archived by the owner on Dec 16, 2020. It is now read-only.

wasm: remove unused "free" function.#404

Merged
PiotrSikora merged 1 commit intoenvoyproxy:masterfrom
PiotrSikora:wasm-free
Feb 10, 2020
Merged

wasm: remove unused "free" function.#404
PiotrSikora merged 1 commit intoenvoyproxy:masterfrom
PiotrSikora:wasm-free

Conversation

@PiotrSikora
Copy link
Contributor

Signed-off-by: Piotr Sikora piotrsikora@google.com

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
@kyessenov
Copy link
Contributor

Will this break older Wasm modules in any way?

@kyessenov
Copy link
Contributor

Also, I don't understand how we can maintain a stable memory footprint in a long running module without free?

@PiotrSikora
Copy link
Contributor Author

We immediately pass the memory ownership into VM after requesting it and copying data, so host never holds to any VM-allocated memory.

No, it won't break old modules.

@kyessenov
Copy link
Contributor

Ack.

@kyessenov
Copy link
Contributor

Does that mean that Wasm holds onto host memory after a memory pressure event? E.g. if module allocates 1GB it cannot give it back to the host?

@PiotrSikora
Copy link
Contributor Author

Does that mean that Wasm holds onto host memory after a memory pressure event? E.g. if module allocates 1GB it cannot give it back to the host?

Wasm VM allocates the whole linear memory block ("RAM") upfront, but it can grow it as needed (up to configureable maximum). I'm not sure if it can actually shrink it back.

@kyessenov
Copy link
Contributor

Yeah, but it sounds like we need some memory management capability to restart modules and revoke memory. Otherwise, it's prone to DoS. I can imagine some of our modules allocate based on the data path input.

@PiotrSikora
Copy link
Contributor Author

Yup.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants