The hidden cost of sync.Pool 0 ▲ howardjohn's blog 58 days ago · Tech · hide · Fediverse post In my last post, The hidden cost of mpsc channels, I discussed a common pitfall with Rust mpsc channels using more memory than intuitive (and subsequently got roasted by people pretending they read the footnotes of the documentation of every transitive dependency they use 🙂). I recently stumbled upon a similar surprising cause of memory utilization in Go, this time in sync.Pool. sync.Pool's "purpose is to cache allocated but unused items for later reuse, relieving pressure on the garbage collector." Notice the goal is not to reduce memory usage, but to reduce allocations. However, without being familiar with the implementation details, it's easy to assume that it doesn't increase memory usage much. Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town