Skip to content

ECO-CMP-JS-004 — Memory leaks via event listeners

  • Category: Computation (CMP)
  • Family: JavaScript (JS)
  • Layer: Code
  • Tier: 2
  • Severity: warning
  • Tags: javascript, memory, leak
  • Legacy ID: ECO-JS-004

Summary

Unremoved listeners retain objects and increase memory over time.

Rationale

Leaks increase baseline memory and trigger more GC work.

Impact

{
  "confidence": 0.7,
  "notes": "Often progressive and hard to notice.",
  "type": "memory"
}

Detection

{
  "languages": [
    "javascript"
  ],
  "method": "hybrid"
}

Remediation

{
  "guidance": "Remove listeners on cleanup; use weak refs where appropriate.",
  "tradeoffs": "Requires lifecycle discipline."
}

Ontology

{
  "system_layers": [
    "code"
  ]
}