I'm writing a collection of example space leaks in Haskell, and would like to write a test suite to catch myself in case I insert any examples that don't actually leak space.
Is there way to test the examples without making a separate executable for each one?
You can detect a space-leak with test, but you can't prove an absence of space leaks. Even if memory profile relatively low it may just point that space leak very small and you have not made enough iterations.
To detect space leaks you may use allocation limits and counters as described here May I limit memory usage per function/monad/thread in Haskell?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With