fix: memory leak in SimpleCache causing MCP connection loss (fixes #118)
- Added cleanupTimer property to track setInterval timer - Implemented destroy() method to clear timer and prevent memory leak - Updated MCP server shutdown to call cache.destroy() - Enhanced HTTP server error handling with transport.onerror - Fixed event listener cleanup to prevent accumulation - Added comprehensive test coverage for memory leak prevention This fixes the issue where MCP server would lose connection after several hours due to timer accumulation causing memory exhaustion. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
- **Memory Leak in SimpleCache**: Fixed critical memory leak causing MCP server connection loss after several hours (fixes #118)
|
||||
- Added proper timer cleanup in `SimpleCache.destroy()` method
|
||||
- Updated MCP server shutdown to clean up cache timers
|
||||
- Enhanced HTTP server error handling with transport error handlers
|
||||
- Fixed event listener cleanup to prevent accumulation
|
||||
- Added comprehensive test coverage for memory leak prevention
|
||||
|
||||
## [2.10.0] - 2025-08-02
|
||||
|
||||
### Added
|
||||
|
||||
Reference in New Issue
Block a user