Skip to content

M2-4: Implement Memory Pressure Tool

Description

Create check_memory_pressure tool for memory usage analysis.

Endpoint

POST /api/v1/tools/check_memory_pressure

Parameters

  • include_slab (boolean): Include kernel slab allocator info

Response Structure (from PRD)

{
  "memory_pressure": {
    "some_avg10": 0.0,
    "full_avg10": 0.0
  },
  "page_faults": {
    "minor_per_sec": 1234,
    "major_per_sec": 2
  },
  "oom_risk_score": 0.2,
  "largest_consumers": [
    {
      "process": "dockerd",
      "rss_mb": 2048,
      "vms_mb": 4096,
      "shared_mb": 512
    }
  ],
  "cache_stats": {
    "buffer_cache_mb": 8192,
    "page_cache_mb": 4096,
    "slab_reclaimable_mb": 1024
  }
}

Estimated Effort

1 day