Memory optimizations for Go systems
Despite its growing popularity as a systems language, Go programs are susceptible to severe performance regressions at large scale. In systems with high memory usage, garbage collection (GC) can cause performance regressions by cannibalizing resources from the main program. The goal of this post is to help you understand:
- How Go GC works at a high level? Why would it impact your system’s performance?
- What causes GC pressure (more resources spent on GC)?
- How to determine if GC pressure is the cause of your performance problems?
- How to measure and profile your program’s heap usage?
- How to identify which part of the code is the culprit?
- What are some steps you can take to lower heap usage and GC pressure?
Source: Memory optimizations for Go systems, an article by Nishant Roy.