hedera-json-rpc-relay
hedera-json-rpc-relay copied to clipboard
Implement a Memory Leak detection Test
Problem
Sometimes changes to the codebase of the relay, as well as upgrades of libraries that are used within the relay, could provoke a memory leak issue. that is not apparent on the tests until we move the version to production environments. That makes it harder to identify, since the release contains many changes, all of wich could be the source of the problem.
Solution
Ideally we need a Test or set of tests that are designed to find and detect memory issues or leaks faster, that we can run on every PR, or at least on every release.
Alternatives
We have worked on a POC that uses node-memwatch to log the differential of the memory heap after each request is made.
see here: https://github.com/hashgraph/hedera-json-rpc-relay/pull/2253
maybe we can extend this solution to perform many requests, simulating load, and then take the diff on heap. compare those results with a baseline and raise a flag in case there is something that changes too drastically.