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