A theory of space leaks is by now even longer overdue! There are
some hopeful signs, though.
In practice, we can now *debug* space leaks quite effectively using
Runciman and Wakeling's heap profiler. Of course this is far from
satisfactory, but even so a big improvement.
For strict functional languages (read ML), Mads Tofte's region
inference can tell us at compile-time which data risks being
long-lived. If there isn't any, we know there are no space leaks.
Maybe the idea can be extended to lazy programs?
You might like to look at Jan Sparud's paper in FPCA '93, which
gives an alternative way of avoiding similar space leaks to
Wadler's `splitting headache'. Sparud's method doesn't require
any modifications to the garbage collector.
John Hughes