memory-leak-diagnosis

Diagnose memory leaks in Linux processes and kernel subsystems from memory metrics.

3|2|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/openeuler-mirror/witty-diagnosis-agent --skill memory-leak-diagnosis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-leak-diagnosis
Source: https://github.com/openeuler-mirror/witty-diagnosis-agent/tree/main/skills/memory-leak-diagnosis
Command: npx skills add https://github.com/openeuler-mirror/witty-diagnosis-agent --skill memory-leak-diagnosis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a systematic, hypothesis-driven framework to identify and diagnose complex memory leaks in both user-space processes and the Linux kernel, preventing system instability and OOM events.

Core Features & Use Cases

  • Multi-Layer Diagnosis: Detects leaks across RSS, anonymous pages, slab caches, vmalloc, and memcg.
  • Hypothesis-Driven Analysis: Uses a structured decision tree to validate specific leak scenarios like heap fragmentation or circular references.
  • Use Case: When a production service experiences a gradual increase in memory usage, use this Skill to automatically collect baseline metrics and isolate whether the root cause is a kernel slab leak or a user-space heap allocation issue.

Quick Start

Use the memory-leak-diagnosis skill to analyze the memory usage of the process with PID 1234 and identify the root cause of its RSS growth.

Frequently Asked Questions about memory-leak-diagnosis

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

FAQPage Schema
How do I diagnose memory leaks in Linux user-space processes and kernel subsystems?

To diagnose memory leaks in Linux, this Skill analyzes memory metrics and allocation patterns across RSS, slab caches, and vmalloc. It uses a hypothesis-driven decision tree to validate specific leak scenarios and generate detailed root cause reports for both user-space and kernel space.

Why does my Linux production service experience gradual RSS growth and how can I isolate the root cause?

Gradual RSS growth often indicates memory leaks. This Skill automatically collects baseline metrics and isolates whether the root cause is kernel slab expansion, vmalloc leaks, cgroup memory pressure, or user-space heap allocation issues using system-level diagnostic tools.

What is the best way to identify kernel slab cache expansion or vmalloc leaks causing OOM events?

The best way to identify kernel slab cache expansion or vmalloc leaks is through hypothesis-driven analysis. This Skill validates specific leak scenarios like heap fragmentation or circular references by analyzing allocation patterns to prevent system instability and OOM events.

Can I use this to analyze cgroup memory pressure and anonymous page leaks?

Yes, you can analyze cgroup memory pressure and anonymous page leaks. This Skill supports multi-layer diagnosis across various memory metrics, detecting leaks within memory cgroups, anonymous pages, and other allocation layers to pinpoint the exact root cause.

How to step-by-step isolate whether a memory leak is a kernel slab leak or a user-space heap allocation issue?

To isolate kernel slab leaks versus user-space heap issues, provide the process PID to start the memory diagnosis. The Skill systematically collects memory metrics, applies a structured decision tree to validate hypotheses, and outputs a detailed root cause report identifying the specific leak source.