Installation

System Requirements

  • OS: Linux (Ubuntu 22.04+ recommended). WSL2 on Windows works too.

  • Python: 3.10 or later

  • RAM: 8 GB minimum, 16 GB recommended for AI analysis

  • GPU: Optional - NVIDIA with 6+ GB VRAM accelerates LLM inference

Step 1: Install MemGuard

git clone https://github.com/memory-analyzer/memguard.git
cd memguard/memguard_release
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Step 2: Install Detection Tools

# Core tools
sudo apt install -y valgrind gcc g++ gdb cppcheck clang-tidy heaptrack

# Facebook Infer
VERSION=v1.2.0
curl -sSL "https://github.com/facebook/infer/releases/download/$VERSION/infer-linux-x86_64-$VERSION.tar.xz" \
  | sudo tar -C /opt -xJ
sudo ln -sf /opt/infer-linux-x86_64-$VERSION/bin/infer /usr/local/bin/infer

# Mozilla rr (build from source for latest CPU support)
sudo apt install -y cmake ninja-build pkg-config capnproto libcapnp-dev
cd /tmp && git clone https://github.com/rr-debugger/rr.git
cd rr && mkdir build && cd build
cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release -Ddisable32bit=ON
ninja -j$(nproc) && sudo ninja install
sudo sysctl kernel.perf_event_paranoid=1

# Neuro-symbolic dependencies
pip install z3-solver tree-sitter tree-sitter-c

Step 3: Install AI Backend

# Ollama - runs locally, no cloud
curl -fsSL https://ollama.com/install.sh | sh
ollama pull qwen2.5-coder:14b-instruct-q4_K_M

Note

All AI inference runs locally on your machine. No data leaves your network. The 14B model needs ~9 GB disk and 8 GB VRAM.

Step 4: Verify

memguard doctor