Describe the bug
Web3 contract creation has a memory leak as described here. I've encountered this issue in other codebases that create contracts objects frequently.
The pattern used here should be replaced by a singleton type pattern that either creates the contract object or retrieves an in memory copy of the contract object.
In long running processes (like a coordinator) frequent requests to static functions retrieving a contract instance (like in a Worker) will cause a memory leak and eventual OOM crash.
Describe the bug Web3 contract creation has a memory leak as described here. I've encountered this issue in other codebases that create contracts objects frequently.
The pattern used here should be replaced by a singleton type pattern that either creates the contract object or retrieves an in memory copy of the contract object.
In long running processes (like a coordinator) frequent requests to static functions retrieving a contract instance (like in a Worker) will cause a memory leak and eventual OOM crash.