[clean-list] Next Heap Size Factor ?

Fabien Todescato f.todescato@larisys.fr
Tue, 21 Nov 2000 18:01:22 +0100


Thanks, John for your clear explanations,

If I am not mistaken, then, the standard garbage collector is a =
two-space
moving copying garbage-collector.

For my personal information, what about the optional mark-scan garbage
collector ? I think I have read somewhere that it is a sliding =
compactor, is
that indeed the case ?

Best regards, Fabien TODESCATO

-----Message d'origine-----
De : johnvg@cs.kun.nl [mailto:johnvg@cs.kun.nl]
Envoy=E9 : mardi 21 novembre 2000 17:49
=C0 : Fabien Todescato
Cc : clean-list@cs.kun.nl
Objet : Re: [clean-list] Next Heap Size Factor ?



>Could somebody explain the exact meaning of the "NextHeap Size Factor"
>parameter of the project options of the Clean 2.0 IDE ?
>
>It is said in the IDE manual that "If a garbage collection does not =
free
>enough memory, the heap is expanded (with the factor Next Heap Size =
Factor)
>up to a maximum (the Maximum Heap Size)."
>
>It is not clear to me what this exactly means, and how that parameter =
can
>impact the run-time characteristics of the programs.

When a Clean program starts, it allocates a heap of "Maximum Heap Size"
bytes,
but initially only uses "Initial Heap Size" bytes. When this initial =
size
has
been used (or half of it when you use the copying collector), the =
garbage
collector is invoked.

When the garbage collector finishes, the amount of heap that is still =
in use
is multiplied by the "Next Heap Size Factor" (or half of it for the =
copying
collector). This heap will then grow or shrink to this amount of =
memory,
and the garbage collector will be invoked again when this memory has =
been
used. If this amount is larger than "Maximum Heap Size", the heap only =
grows
to this maximum size.

So after each garbage collection we use the "Next Heap Size" factor to
compute the size of the heap until the next garbage collection.

If you use a small "Heap Size Factor" your program will use less memory =
and
have fewer cache misses. However the garbage collection will be invoked
more often and so garbage collection will use more time.

The opposite happens if you use a large "Heap Size Factor": the program =
uses
more memory, has more cache misses (or even page misses), but garbage
collections will happen less often and garbage collection will use
less time.

Regards,

John van Groningen



_______________________________________________
clean-list mailing list
clean-list@cs.kun.nl
http://www.cs.kun.nl/mailman/listinfo/clean-list