Garbage collection

Mike Parker aldacron at gmail.com
Sat Jun 27 11:15:42 UTC 2020


On Saturday, 27 June 2020 at 11:11:38 UTC, James Gray wrote:

>
> 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?

It's not a leak. The GC allocates memory as it needs it and holds 
on to it. When something is collected, the GC can reuse then 
released memory when it needs it.


More information about the Digitalmars-d-learn mailing list