Closed XY-Wang closed 8 months ago
Additional note: same memoize
is used to wrap all RPC interface methods and internal getBlockHash
and getBlockRegistry
in the Api. So even without long-running subscriptions the API could run out of memory if makes too many requests.
ApiRx subscriptions are memoized using an in-memory object as cache that is only cleaned up on unsubscribe. For our case this causes the server to run out of memory after running for some hours.
https://github.com/polkadot-js/common/blob/db25938ad7867d98abad0cdb457b6aabb4bec38b/packages/util/src/memoize.ts#L22