Company
Date Published
Author
Aviv Zohari
Word count
748
Language
English
Hacker News points
1

Summary

The text discusses a memory leak issue in a Go service that was causing OOM errors during normal operation. Despite using garbage collection, the service was accumulating memory and eventually reaching its limits, leading to an error. The authors suspected the issue might be related to the runtime not releasing memory back to the OS quickly enough, but this was fixed in Go 1.16. To investigate, they used `pprof`, a profiling tool that provides extensive information about CPU and memory usage, making it easy to identify the source of the leak. The resulting profile showed that one function, `MetricsFetcher.parseContainerMetricsResponse`, was responsible for allocating most of the live heap, indicating an intended behavior issue. By analyzing the call flow leading up to this function, they were able to pinpoint the exact lines of code causing the problem and identify the root cause of the memory leak.