Skip to content

rar-file/MemLyze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memlyze

Visual memory profiler with <5% overhead
Find leaks, optimize allocations, understand your memory

Status Python License Platform


Why Memlyze?

Visual Timeline
Scrub through time, see when leaks started
Fast
<5% overhead, handles millions of allocations
Interactive
Click any spike → see exact code location
Smart
Finds reference chains, detects leaks automatically

Compared to Alternatives

Tool Overhead Visualization Languages Production Ready
Valgrind ❌ 20-50x slower 📝 Text only C/C++ ❌ Too slow
Chrome DevTools ⚠️ 10-20x slower 📸 Snapshots JavaScript ⚠️ Dev only
Python tracemalloc ⚠️ ~10% overhead 📝 Text only Python ⚠️ Limited
Memlyze <5% overhead 📊 Interactive timeline Python, Node, Rust Yes!

Quick Start

1. Install

pip install -e tracer/

2. Record a trace

memlyze record python your_app.py

3. Analyze

memlyze analyze trace.mlyze

Example Usage

Python API

import Memlyze

# Start tracing
tracer = Memlyze.start(
    output_file="trace\.mlyze",
    sample_rate=1.0,
    max_stack_depth=10,
    track_gc=True
)

# Run your application
run_my_app()

# Stop and save
tracer.stop()

CLI Usage

# Basic tracing
Memlyze record python app.py

# Low overhead (10% sampling)
Memlyze record \
  --sample-rate 0.1 \
  python app.py

# Production monitoring (1%)
Memlyze record \
  --sample-rate 0.01 \
  --max-stack-depth 5 \
  python app.py

Project Status

Phase Status Features
Phase 1
Python Tracer MVP
COMPLETE ✅ Binary format specification
✅ Memory tracer with stack traces
✅ Efficient file writer
✅ CLI tool
✅ Example programs
Phase 2
Analysis Engine
🚧 NEXT 🚧 Rust-based trace parser
🚧 Timeline builder
🚧 Leak detection
🚧 JSON export
Phase 3
Web Visualization
📅 Planned 📅 React app
📅 Canvas timeline
📅 Heatmap/flamegraph
📅 WASM integration

Architecture

Memlyze/
├── tracer/              # Python memory tracer
│   ├── Memlyze/        # Core library
│   │   ├── tracer.py    # Allocation tracking
│   │   ├── format.py    # Binary format
│   │   └── writer.py    # File I/O
│   └── setup.py
├── analyzer/            # Rust analysis engine (Phase 2)
├── web-ui/              # React visualization (Phase 3)
├── cli/                 # Rust CLI tool (Phase 4)
├── examples/            # Sample programs
└── benchmarks/          # Performance tests

Documentation

Performance Targets

CPU Overhead <5% Fast enough for production
Memory Overhead <100MB For 1M allocations
Trace File Size <1MB Per 100k allocations (compressed)
Analysis Speed <1 second Process 1M allocations

License

MIT License - See LICENSE file for details

Contributing

Contributions welcome! See CONTRIBUTING.md for details.

Credits

Built with ❤️ by RAR

About

Initial release: Memlyze v0.1.0 - Python memory profiler with <5% overhead

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages