You can detect a space leak with the test, but you cannot prove the absence of space leaks. Even if the memory profile is relatively low, it can simply indicate that the space leak is very small and you havenβt done enough iterations.
To detect space leaks, you can use limits and allocation counters as described here. Is it possible to limit memory usage for each / monad / thread function in Haskell?
schernichkin
source share