ouroboros-network icon indicating copy to clipboard operation
ouroboros-network copied to clipboard

Analyse TVar memory leak when using `ghc-9.8`

Open coot opened this issue 1 year ago • 2 comments

One can reproduce the problem with this repo.

We know the problem is caused by pipelining, especially when maximal pipelining depth is heigh. Some ideas to simplify the repository:

  1. eliminate cpsVar
  2. swap doneVar for an MVar
  3. eliminate Channel and use connectPipelined instead,
  4. eliminate usage of typed-protocols, and run ChainSyncServer against ChainSyncClientPipelined against each other with: directPipelined.
  5. simplify chain-sync protocol

coot avatar Jan 12 '24 14:01 coot

We found out that the memory leak was resolved when the number of pipelined messages was reduced to a small number. There's more information about it in an unfortunately private slack thread.

coot avatar Feb 05 '24 13:02 coot

tvar-memleak-test.zip

The repo above no longer exists but was saved

bolt12 avatar Apr 24 '24 11:04 bolt12