-
-
Notifications
You must be signed in to change notification settings - Fork 254
Closed
Description
Bug Report: WebKit.WebContent High CPU Usage Causing UI Lag
Description
CodexMonitor's WebKit.WebContent process consistently consumes 60-75% CPU and 1-1.7GB RAM, causing severe UI lag (500ms-2s delay on clicks) even on an M2 MacBook Pro with 16GB RAM.
Environment
- CodexMonitor Version: 0.7.48
- macOS: 15.6.1 (24G90)
- Hardware: MacBook Pro M2 (Apple Silicon)
- RAM: 16GB
- Installation Method: DMG download from GitHub releases
Steps to Reproduce
- Launch CodexMonitor v0.7.48
- Wait 30-60 seconds for app to fully initialize
- Interact with UI (click sidebar items, switch threads)
- Observe significant lag on every interaction
Expected Behavior
UI should be responsive with <100ms click latency, WebKit process should idle at <5% CPU.
Actual Behavior
- WebKit.WebContent process: 60-75% CPU, 1-1.7GB RAM
- CodexMonitor main process: normal (~0-5% CPU, ~100-150MB RAM)
- UI lag: 500ms-2s delay on every click
- System load average spikes to 10-40
Process Details
PID 17784: WebKit.WebContent
- CPU: 66.2% → 75.3% (spikes)
- RAM: 1.0GB → 1.7GB (grows over time)
- Parent: launchd (system process)
Diagnostic Data
Memory Pressure:
- System-wide free: 45-47% (was lower during peak usage)
- Swap I/O active: 120,000+ swapouts observed
- Compressed pages: 6M+ pages
Top Memory Consumers During Issue:
- WebKit.WebContent (CodexMonitor): ~1.7GB RAM, 75% CPU
- Google Chrome: ~2.9GB RAM (multiple processes)
- Antigravity (VS Code): ~1.6GB RAM
- Wispr Flow: ~0.6GB RAM
System State:
Load Avg: 3.56 - 40.24
PhysMem: 15G used (94% utilization)
Free RAM: ~74MB (critically low)
Attempted Workarounds
- ✅ Killed WebKit process manually - Immediate relief, but WebKit respawns and problem returns
- ✅ Restarted CodexMonitor - Process resets to ~150MB/0% CPU, then grows back to 1GB+/60%+ CPU within minutes
- ✅ Reduced workspaces - Removed several workspaces, minimal impact
- ❌ System restart - Not attempted yet
- ❌ Reset CodexMonitor settings - Not attempted yet (risk of losing workspace config)
Root Cause Analysis
The issue appears to be application-level, not system-level:
- WebKit process consistently enters "spin loop" state after app startup
- Problem persists across app restarts (fresh WebKit process exhibits same behavior)
- Other Tauri/WebKit apps on same system do not show this behavior
- CPU profile shows WebKit in
IPC::Connection::dispatchIncomingMessages()loops
Hypothesis
Possible causes:
- React rendering loop - UI component stuck in infinite re-render cycle
- Thread status polling - Excessive polling of codex app-server processes
- WebSocket/IPC message flooding - Rapid message exchange between main process and WebKit
- Large workspace/thread list - Rendering performance issue with many items
Logs
WebKit process suspension logs show rapid foreground/background activity cycling:
ProcessThrottler::Activity::Activity: Starting foreground activity
ProcessThrottler::Activity::invalidate: Ending foreground activity
WebProcessProxy::didChangeThrottleState: type=1
Impact
- Severity: High - App becomes unusable for productive work
- Frequency: Always reproducible after app startup
- Workaround: None effective (only temporary relief via process kill)
Request
Please investigate:
- Memory leak in React/Tauri frontend
- IPC message handling efficiency
- Thread/workspace polling frequency
- Any recent changes in v0.7.48 that might affect WebKit performance
Happy to provide additional diagnostics (sample traces, memory graphs, etc.) upon request.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels