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

1
The Beautiful Web
Jens Oliver Meiert 2 votes
2
Container queries are rad AF!
Chris Ferdinandi 2 votes
3
Wagon’s algorithm in Python
John D. Cook 1 votes
5
Top picks — 2026 January
Paweł Grzybek 1 votes
6
In Praise of –dry-run
Henrik Warne 1 votes
8
Vibe coding your first iOS app
William Denniss 1 votes