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

reduction of wavm memory usage #7171

Merged
merged 3 commits into from
Apr 24, 2019
Merged

reduction of wavm memory usage #7171

merged 3 commits into from
Apr 24, 2019

Conversation

spoonincode
Copy link
Contributor

Change Description

wavm tends to cause significant memory usage even when fixes like #6983 are in place. This PR includes two changes that reduce the memory usage of WAVM by a large margin. First: avoid generation of debug information; this was actually done at a per-wasm-opcode resolution so it was very memory intensive and also tended to wedge things in to a global cache that would never be freed. Second: free the WAVM Module after we no longer need it once a ModuleInstance is created from it

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

generation of debug info consumes a massive amount of memory and quite a bit of it seems to get lodged in the global llvmcontext meaning it becomes a leak in the current design of wavm. Removing this as we don't need it
After creating a ModuleInstance from a Module, we really don't need to hold on to the Module any longer. It's a memory sink. Refactor the one instance we needed the Module and free it after that
libraries/chain/webassembly/wavm.cpp Outdated Show resolved Hide resolved
libraries/wasm-jit/Source/Runtime/LLVMJIT.cpp Show resolved Hide resolved
this lookup should be well protected; but no complaints to protect it further it's not a hot path or anything
@arhag arhag merged commit 1b797b2 into develop Apr 24, 2019
@spoonincode spoonincode deleted the reduce_wavm_memory_usage 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