General Problems for GC'ed Applications?

Sean Kelly sean at f4.ca
Thu Jul 27 13:27:42 PDT 2006


Walter Bright wrote:
> 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.

By the way, there's no reason that even a full collect must swap all 0.8 
GB back in.  Some GCs use an alternate approach where pages are scanned 
and marked stale when the VMM swaps them to disk, so no page faults 
occur on collection runs.



Sean



More information about the Digitalmars-d mailing list