swap-thrashing-diagnosis

Diagnose Linux swap thrashing by correlating system metrics with kernel memory behavior.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bash, sar, vmstat, iostat, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill resolves complex system performance issues caused by memory pressure, swap thrashing, and kernel-level memory management inefficiencies, preventing system-wide freezes and OOM events.

Core Features & Use Cases

  • Dual-Track Analysis: Simultaneously correlates real-time system metrics with kernel-level semantic behavior to pinpoint root causes.
  • Automated Branching: Automatically identifies specific failure modes like swap exhaustion, SSD wear, or kswapd CPU spikes and executes targeted diagnostic scripts.
  • Use Case: When a server becomes unresponsive due to high iowait and constant disk activity, this Skill identifies whether the issue is a memory leak, misconfigured swappiness, or a failing SSD, providing a clear path to resolution.

Quick Start

Run the swap thrashing diagnosis script on the current system to collect baseline metrics and receive an automated root cause analysis report.

Frequently Asked Questions about swap-thrashing-diagnosis

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

FAQPage Schema
How do I diagnose Linux swap thrashing and high iowait in production?

Diagnose Linux swap thrashing by correlating runtime system metrics with kernel-level memory management behavior. This process pinpoints root causes like swap exhaustion or kswapd CPU spikes to provide actionable remediation steps.

Why does kswapd consume high CPU during memory pressure stalls?

kswapd CPU spikes occur during memory pressure stalls when the kernel aggressively reclaims memory. Correlating real-time system metrics with kernel semantic behavior identifies whether misconfigured swappiness or memory leaks drive this thrashing.

How do I troubleshoot system-wide freezes and OOM events caused by memory exhaustion?

Troubleshoot system-wide freezes from memory exhaustion by running dual-track analysis. This simultaneously evaluates real-time metrics and kernel memory management to prevent OOM events and resolve performance degradation.

Can I use sar and vmstat to identify SSD wear causing swap exhaustion?

Yes, sar and vmstat are utilized to collect baseline metrics for identifying SSD wear causing swap exhaustion. Automated branching analyzes these metrics to execute targeted diagnostic scripts for specific failure modes.

What is the best way to correlate eBPF-ready scripts with kernel configuration for memory remediation?

The best way to achieve memory remediation is utilizing eBPF-ready scripts alongside kernel configuration analysis. This dual-track approach correlates real-time metrics with kernel behavior to provide targeted resolution paths.

Does this swap thrashing diagnosis require specific Linux kernel environments?

This swap thrashing diagnosis targets Linux production environments experiencing memory pressure. It requires bash, sar, vmstat, and iostat dependencies to effectively correlate runtime system metrics with kernel-level memory management behavior.