Garbage collection

James Gray test at test.com
Sat Jun 27 11:11:38 UTC 2020


On Saturday, 27 June 2020 at 11:00:58 UTC, Stanislav Blinov wrote:
> On Saturday, 27 June 2020 at 10:08:15 UTC, James Gray wrote:
>
>> I find that the memory usage grows to about 1.5GB and never 
>> decreases. Is there something I am not understanding?
>
> How are you measuring that? GC.collect() does not necessarily 
> release the pages to the OS. For that, there's the 
> GC.minimize().

I am measuring the memory usage using top from the command line.
GC.minimize() does seem to stop the leak. But it doesn't explain 
why
the program isn't releasing essentially all the memory between 
calls
to f (it using around 2GB ram all the time). Is there a way of 
achieving that?


More information about the Digitalmars-d-learn mailing list