[Baseline] Pre-zombie-fix checkpoint
Investigation complete - 5 agents identified root causes: - periodic_save_check.py: 540 processes/hour (53%) - Background sync-contexts: 200 processes/hour (20%) - user-prompt-submit: 180 processes/hour (18%) - task-complete: 90 processes/hour (9%) Total: 1,010 zombie processes/hour, 3-7 GB RAM/hour Phase 1 fixes ready to implement: 1. Reduce periodic save frequency (1min to 5min) 2. Add timeouts to all subprocess calls 3. Remove background sync-contexts spawning 4. Add mutex lock to prevent overlaps See: FINAL_ZOMBIE_SOLUTION.md for complete analysis Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
28
check_zombie_processes.ps1
Normal file
28
check_zombie_processes.ps1
Normal file
@@ -0,0 +1,28 @@
|
||||
# Check for zombie/orphaned processes during Claude Code sessions
|
||||
# This script identifies processes that may be consuming memory
|
||||
|
||||
Write-Host "[INFO] Checking for zombie processes..."
|
||||
Write-Host ""
|
||||
|
||||
# Check for Python processes
|
||||
$pythonProcs = Get-Process | Where-Object {$_.ProcessName -like '*python*'}
|
||||
Write-Host "[PYTHON] Found $($pythonProcs.Count) Python processes"
|
||||
if ($pythonProcs.Count -gt 0) {
|
||||
$pythonProcs | Select-Object ProcessName, Id, @{Name='MemoryMB';Expression={[math]::Round($_.WorkingSet64/1MB,2)}}, StartTime | Format-Table -AutoSize
|
||||
}
|
||||
|
||||
# Check for Node processes
|
||||
$nodeProcs = Get-Process | Where-Object {$_.ProcessName -like '*node*'}
|
||||
Write-Host "[NODE] Found $($nodeProcs.Count) Node processes"
|
||||
if ($nodeProcs.Count -gt 0) {
|
||||
$nodeProcs | Select-Object ProcessName, Id, @{Name='MemoryMB';Expression={[math]::Round($_.WorkingSet64/1MB,2)}}, StartTime | Format-Table -AutoSize
|
||||
}
|
||||
|
||||
# Check for agent-related processes (background tasks)
|
||||
$backgroundProcs = Get-Process | Where-Object {$_.CommandLine -like '*agent*' -or $_.CommandLine -like '*Task*'}
|
||||
Write-Host "[BACKGROUND] Checking for agent/task processes..."
|
||||
|
||||
# Total memory summary
|
||||
$totalMem = (Get-Process | Measure-Object WorkingSet64 -Sum).Sum
|
||||
Write-Host ""
|
||||
Write-Host "[SUMMARY] Total system memory in use: $([math]::Round($totalMem/1GB,2)) GB"
|
||||
Reference in New Issue
Block a user