3 ms·
Excellent optimization technique: manually copying objects to a new slice so they don't prevent the GC from releasing memory by sitting right in the middle of a
by okzgn 2mo ago
Excellent optimization technique: manually copying objects to a new slice so they don't prevent the GC from releasing memory by sitting right in the middle of a page it intends to free.
- amelius 2mo agoThat's what every "copying GC" does. https://www.cs.cornell.edu/courses/cs312/2003fa/lectures/sec24.htm https://www.cs.cornell.edu/courses/cs312/2003fa/lectures/sec...
- okzgn 2mo agoOf course, but Go's GC doesn't compact or relocate the objects still in use in the middle of a page (which means that page can't be released to the OS) until you manually copy those surviving objects out, freeing up the page they left behind.