Re: Another space leak question

At 10:14 AM 7/2/2001 +0000, kahl@heraklit.informatik.unibw-muenchen.de wrote:
The reason is that the addition in step1 is deferred lazily, since its result is never needed. Therefore, unreduced additions accumulate.
I just thought of a question for compiler/interpreter makers out there... Couldn't the garbage collector start doing reductions as soon as it can't free up enough heap? Like a second step in garbage collection. It'd need some simple heuristic to decide what to reduce, but in the end, Haskell being pure, the order of evaluations won't affect the result. Call it an emergency garbage collection step. Is there anything I'm missing that would make this not possible? Salutaciones, JCAB --------------------------------------------------------------------- Juan Carlos "JCAB" Arevalo Baeza | http://www.roningames.com Senior Technology Engineer | mailto:jcab@roningames.com Ronin Entertainment | ICQ: 101728263 (my opinions are only mine) JCAB's Rumblings is so off-line O:-(

Juan Carlos Arevalo Baeza writes: : | Couldn't the garbage collector start doing reductions as soon as it | can't free up enough heap? : Despite their name, reductions don't necessarily reduce space use. For more details, see: http://haskell.org/pipermail/haskell/2001-June/001303.html Regards, Tom

At 08:44 AM 7/3/2001 +1200, Tom Pledger wrote:
Juan Carlos Arevalo Baeza writes: : | Couldn't the garbage collector start doing reductions as soon as it | can't free up enough heap? :
Despite their name, reductions don't necessarily reduce space use.
Well, certainly not all, but certainly some of them would. (7+1) can always be reduced down to 8, which does reduce space. Thus the necessary heuristics.
For more details, see:
Yes, I remember that message. Still, it seems to me that a good RTS can (and should) be sophisticated enough to exhaust all reduction possibilities before giving up and aborting the program. Garbage collection is one (very necessary) such thing. Forced reduction like I was saying is another possible such thing. Only thing I can think of as a disadvantage to having this functionality is that it promotes the creation of inefficient programs. Salutaciones, JCAB --------------------------------------------------------------------- Juan Carlos "JCAB" Arevalo Baeza | http://www.roningames.com Senior Technology Engineer | mailto:jcab@roningames.com Ronin Entertainment | ICQ: 101728263 (my opinions are only mine) JCAB's Rumblings is so off-line O:-(
participants (2)
-
Juan Carlos Arevalo Baeza
-
Tom Pledger