Tool to detect and compare memory leaks across any go-redis versions.
Related to: go-redis#3465
# Setup
git clone https://github.com/yourusername/go-redis-memory-test.git
cd go-redis-memory-test
make setup
# Test versions (required - specify which versions to test)
make test v9.11.0 v9.12.0 v9.12.1 # Recommended: test the leak
make test v9.11.0 # Test single versionTesting shows significant memory issues in v9.12.0 and v9.12.1:
| Version | Memory Usage | GC Activity | Leak Status |
|---|---|---|---|
| v9.11.0 | ~3 MB avg | Normal (21 GCs/min) | ✅ No leak |
| v9.12.0 | ~52 MB avg | Poor (5 GCs/min) | ❌ Severe leak |
| v9.12.1 | ~28 MB avg | Poor (7 GCs/min) |
Note: v9.12.0+ has larger buffer sizes (ReadBufferSize/WriteBufferSize) which increase initial allocation, but the continuous memory growth indicates actual memory leaks.
- Starts a 6-node Redis cluster using Docker
- Tests each specified version for 5 minutes
- Runs intensive operations (SET, GET, pipelines, pub/sub)
- Analyzes memory GROWTH RATE after warmup period
- Generates comparison charts (when testing 2+ versions)
The tool focuses on memory growth rate (not initial allocation) after a warmup period:
- ❌ Severe Leak: >10 MB/minute growth
⚠️ Moderate Leak: 5-10 MB/minute growth- 🟡 Possible Leak: 1-5 MB/minute growth
- 🔵 Minor Leak: 0.5-1 MB/minute growth
- ✅ No Leak: <0.5 MB/minute growth
Important: The analysis ignores initial memory allocation differences (which can be due to buffer size changes) and focuses purely on continuous growth patterns that indicate actual memory leaks.
Results are saved to output/comparison_YYYYMMDD_HHMMSS/:
memory_stats_vX.Y.Z.csv- Raw data per versiontest_vX.Y.Z.log- Test logs per versioncomparison.png- Visual comparison (2+ versions)comparison_report.txt- Detailed analysis (2+ versions)
# Test latest versions
make test v9.12.0 v9.12.1 v9.13.0
# Test patch versions
make test v9.11.0 v9.11.1 v9.11.2
# Test major version differences
make test v8.11.5 v9.0.0 v9.12.0- Docker & Docker Compose
- Go 1.19+
- Python 3.8+ (matplotlib, pandas, numpy)
- ~2GB RAM
- ~500MB disk space
make clean
# Wait a few seconds
make test v9.11.0 v9.12.0 v9.12.1Versions must be in format vX.Y.Z (e.g., v9.11.0)
docker-compose -f docker/docker-compose.yml down -v
docker system prune -f