memleak-investigate

Analyze Linux process memory leaks via /proc, gdb, and eBPF tracing.

Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rahulrajaram/rahulskills --skill memleak-investigate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memleak-investigate
Source: https://github.com/rahulrajaram/rahulskills/tree/main/skills/memleak-investigate
Command: npx skills add https://github.com/rahulrajaram/rahulskills --skill memleak-investigate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bpftrace, gdb, procps, binutils, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a systematic approach to identifying and diagnosing memory leaks in Linux processes, helping to resolve issues like high memory usage, OOM errors, and system instability.

Core Features & Use Cases

  • Multi-Phase Investigation: Progresses from safe /proc inspection to advanced eBPF tracing.
  • Diagnostic Tools: Leverages ps, free, maps, smaps, gdb, and bpftrace for deep analysis.
  • Use Case: When a critical service's memory consumption steadily increases over days, leading to performance degradation, this Skill can pinpoint the exact cause and location of the leak.

Quick Start

Investigate memory leaks for the process with PID 12345.

Frequently Asked Questions about memleak-investigate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I diagnose a memory leak in a Linux process?

Diagnosing a Linux memory leak involves systematically analyzing /proc filesystem data, checking allocator statistics with gdb, and using eBPF tracing to pinpoint allocation call sites and leak sources.

What's the best way to troubleshoot growing RSS and OOM conditions on Linux?

Troubleshooting growing RSS and OOM conditions requires analyzing /proc/smaps and using bpftrace to trace allocation patterns, helping identify the exact cause of system instability and swap exhaustion.

Do I need bpftrace and gdb to investigate memory leaks?

You need bpftrace for advanced eBPF tracing of allocation patterns, while gdb is optional for deep dives into allocator statistics; basic investigation uses ps, free, and /proc maps data.

How does eBPF tracing help find memory allocation call sites?

eBPF tracing helps find memory allocation call sites by dynamically monitoring allocator functions in real-time, capturing the exact code paths and processes responsible for continuous memory growth.

Can I use this approach to investigate memory leaks for a specific process PID?

Yes, you can investigate memory leaks for a specific process PID by targeting it with /proc inspection tools like ps and smaps, then applying bpftrace tracing to isolate its allocation behavior.