GoFree: Reducing Garbage Collection via Compiler-inserted Freeing
In a memory-managed programming language, programmers allocate memory by creating new objects, but programmers never free memory. A garbage collector periodically 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 ($𝑂(𝑁^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.1% of allocated heap memory. It reduced GC frequency by 7.3%, GC time by 13.0%, wall-clock time by 2.0%, and heap size by 3.6%.
Wed 5 MarDisplayed time zone: Pacific Time (US & Canada) change
11:40 - 13:00 | |||
11:40 20mTalk | Honey Potion: an eBPF Backend for Elixir Main Conference Kael Soares Augusto UFMG, Vinícius Pacheco Cadence, Marcos A. M. Vieira Universidade Federal de Minas Gerais, Rodrigo G. Ribeiro Federal University of Ouro Preto, Fernando Magno Quintão Pereira Federal University of Minas Gerais | ||
12:00 20mTalk | 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 | ||
12:20 20mTalk | 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 20mTalk | 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 |