Garbage collection

Stanislav Blinov stanislav.blinov at gmail.com
Sat Jun 27 16:06:05 UTC 2020


On Saturday, 27 June 2020 at 16:03:12 UTC, kinke wrote:
> On Saturday, 27 June 2020 at 15:27:34 UTC, Stanislav Blinov 
> wrote:

>> Hrm... What happens if you call collect() twice?
>
> Nothing changes, even when collecting 5 times at the end of 
> each iteration. In the filed testcase, I've extracted the stack 
> ref to a dedicated function, so that there really shouldn't be 
> any refs on the stack (this is unoptimized code after all...).

Here on Linux, the double collection results in this output:

   GC stats: 0M used, 0M free, 0M total
Starting
   string size: 943M
   GC stats: 0M used, 2306M free, 2306M total
Starting
   string size: 943M
   GC stats: 0M used, 2306M free, 2306M total
Starting
   string size: 943M
   GC stats: 0M used, 2306M free, 2306M total
Starting
   string size: 943M
   GC stats: 0M used, 2306M free, 2306M total


More information about the Digitalmars-d-learn mailing list