In a memory-managed programming language, programmers allocate but don’t free memory. A garbage collector (GC) reclaims memory used by unreachable objects. As an optimization based on escape analysis, some memory can be freed explicitly by instructions inserted by the compiler. This optimization reduces the cost of garbage collection, without changing the programming model.

We designed and implemented this explicit freeing optimization for the Go language. We devised a new escape analysis that is both powerful and fast ($O(N^2)$ time). Our escape analysis identifies short-lived heap objects that can be safely explicitly deallocated. We also implemented a freeing primitive that is safe for use in concurrent environments.

We evaluated our system, GoFree, on 6 open-source Go programs. GoFree did not observably slow down compilation. At run time, GoFree deallocated on average 14% of allocated heap memory. It reduced GC frequency by 7%, GC time by 13%, wall-clock time by 2%, and heap size by 4%. We open-source GoFree.

Wed 5 Mar

Displayed time zone: Pacific Time (US & Canada) change

12:00 - 13:00
Runtime & System ToolsMain Conference at Casuarina Ballroom (Level 2)
Chair(s): Ajay Brahmakshatriya Massachusetts Institute of Technology
12:00
20m
Talk
GoFree: Reducing Garbage Collection via Compiler-inserted Freeing
Main Conference
Haoran Peng University of Science and Technology of China, Yu Zhang University of Science and Technology of China, Michael D. Ernst University of Washington, Jinbao Chen University of Science and Technology of China, Boyao Ding University of Science and Technology of China
DOI
12:20
20m
Talk
Improving Native-Image Startup Performance
Main Conference
Matteo Basso Università della Svizzera italiana (USI), Aleksandar Prokopec Oracle Labs, Andrea Rosà USI Lugano, Walter Binder USI Lugano
12:40
20m
Talk
Speeding up the Local C++ Development Cycle with Header Substitution
Main Conference
Nader Al Awar The University of Texas at Austin, Zijian Yi The University of Texas at Austin, George Biros The University of Texas at Austin, Milos Gligoric The University of Texas at Austin