It can be very frustrating when Go applications use less memory than what is available to them, and yet they still manage to run out of memory and crash. Go 1.19 introduced GOMEMLIMIT, which completely changes how you can manage memory limits in Go. By Etienne Dilocker.
In this article, author will invite you on a journey. He will cover:
- How memory allocations work in Go
- When the Garbage Collector runs, and what the implications are
- Why it was far too easy to run out of memory before Go 1.19
- What GOMEMLIMT is and why it can prevent premature OOM kills
- Run an experiment first without and then with GOMEMLIMI
Go 1.19 changes everything: The new GOMEMLIMIT feature can help you both increase GC-related performance as well as avoid GC-related out-of-memory (“OOM”) situations. Good read!
[Read More]