Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Avoid possibly lengthy destruction of wasm instances on shutdown #7177

Merged
merged 3 commits into from
Apr 24, 2019

Conversation

spoonincode
Copy link
Contributor

Change Description

When the wasm_interface is destroyed, all unique_ptrs to the current instantiated modules are also destroyed. Unfortunately for some wasm runtimes -- wavm with #7176 -- this incurs a lengthy garbage collection process for each module that is deleted. This can cause destruction of wasm_interface to take on the order of multiple minutes when there are thousands of instances! We need to violate the abstraction layer here and drop these instances on the floor during shutdown so the user isn't waiting minutes

I am completely open to other approaches here

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

When the wasm_interface is destroyed, all unique_ptrs to the current instantiated modules are also destroyed. Unfortuately for some wasm runtimes -- wavm -- this incurs a lengthy garbage collection process for each module that is deleted. This can cause destruction of wasm_interface to take on the order of multiple minutes when there are thousands of instances! We need to violate the abstraction layer here and drop these instances on the floor during shutdown so the user isn't waiting minutes
@arhag arhag merged commit 7835b9e into develop Apr 24, 2019
@spoonincode spoonincode deleted the drop_wasm_instances_on_floor_at_shutdown branch April 25, 2019 21:45
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