[m-rev.] for review: stseg grades documentation

Peter Wang novalazy at gmail.com
Wed Nov 7 11:05:37 AEDT 2007


On 2007-11-06, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
> 
>  For review by PeterW.
> 
>  Estimated hours taken: 0.5
>  Branches: main
> 
>  compiler/options.m
>  doc/user_guide.texi:
>  	Address some of PeterW's comments regarding the documentation
>  	of the .stseg grades

Great, thanks.

I don't have any numbers on the reduced memory consumption, but it's at
least conceptually true.  If you have a program that requires peak stack
usage of M words, then obviously you need to reserve at least M words
for the stack, but as you don't know what M is in advance, you'd
probably reserve a lot more than you need.  With stack segments it would
only allocate enough segments to hold M words (modulo some overhead).

Also, a short spike in stack usage may leave many pointer-like values on
the stack, causing the conservative GC to retain more memory than
necessary.  With stack segments, once a segment is unneeded it can be
deallocated or cleared, reducing that problem.

But in practice the reduced memory usage is probably only noticeable
when you start using lots of contexts.

Peter

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list