Philippe Gaultier 3/12/2025

Tip of the day #6: Use Bpftrace to estimate how much memory an in-memory cache will use

Read Original

This article details a method for estimating the memory footprint of an in-memory LRU cache in a Go service without modifying the source code. The author demonstrates using Bpftrace (or DTrace) to attach a probe to the cache insertion function, collect a histogram of cache entry sizes, and use this data to inform configuration and Kubernetes memory limits. It covers the bpftrace command, function argument handling, and the benefits of runtime tracing for performance analysis.

Tip of the day #6: Use Bpftrace to estimate how much memory an in-memory cache will use

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

2
Designing Design Systems
TkDodo Dominik Dorfmeister 2 votes
3
Introducing RSC Explorer
Dan Abramov 1 votes
5
Fragments Dec 11
Martin Fowler 1 votes
6
Adding Type Hints to my Blog
Daniel Feldroy 1 votes
7
Refactoring English: Month 12
Michael Lynch 1 votes
9