Highly concurrent stm can lead to apparent leakage.
During the development of a tiny tool to aggressively test STM, I came across a strange behaviour, whereby memory seemed to increase without obvious reason.
Using Main.hs, and compiling it with 8.6.5 like:
ghc Main.hs -threaded
and executing it with
Main +RTS -N8
ran pretty much in constant ~22mb of memory. However once we increase depositor
and withdrawer
to say: 100 and 10 or 1000 and 1000, not only does
the reading (as visible by the dots printed to stdout) become irregular, memory also increases with time.