General Problems for GC'ed Applications?
Walter Bright
newshound at digitalmars.com
Thu Jul 27 13:00:43 PDT 2006
Karen Lanrap wrote:
> I disagree. Assume a non GC'ed program that allocates 1.5 GB to 1.7
> GB memory, from which 0.7 GB to 0.9 GB are vital data. If you run
> this program on a machine equipped with 1 GB, the OS will swap out
> the 0.8 GB data that is accessed infrequently. Therefore this
> program cause swapping only if it accesses data from the swapped
> out part of data and the size of the swapped data will be
> approximately bounded by doubling the size of the data needed to be
> swapped back.
>
> This changes dramatically if you GC it, because on every allocation
> the available main memory is exhausted and the GC requires the OS
> to swap all 0.8 GB back, doesn't it.
No, it doesn't require it to all be swapped in. It fact, it doesn't
require any of it to be swapped in, unless a full collect is done. Full
collects are not performed on every allocation - that would be a
terrible design if it did.
More information about the Digitalmars-d
mailing list