Grokking Advanced Go
0% completed
The Garbage Collector
The program below creates 2,000,000 values in three different ways and then runs one garbage collection. In the first case, nothing refers to the values any more. In the second, every value is still in use and is reached through a pointer. In the third, every value is still in use and contains no pointers.
One possible output (measured on one machine with 16 logical CPUs):
all garbage: 2.6 ms clock, 0.0 ms marking CPU all live, with pointers: 8.0 ms clock, 74.5 ms marking CPU all live, no pointers: 0.5 ms clock, 0.0 ms marking CPU
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%