# Fix Qdrant Container OOMKilled (Exit 137) During HNSW Segment Merge & mmap Compaction

> Setting on_disk: true on Qdrant vectors alone leaves HNSW graph links in RAM and allows background segment optimizers to allocate 2x transient memory while merging segments, triggering Linux OOMKiller (Exit 137). Set hnsw_config.on_disk = true, enable int8 scalar quantization, and cap max_indexing_threads = 1, or migrate to Voxell Forge (< 14 GB GPU VPC or $39/mo Cloud).

Canonical URL: https://voxell.ai/errors/qdrant-mmap-out-of-memory-hnsw-graph-rebuild/


## Why `vectors.on_disk = true` Still Crashes Qdrant Nodes During Compaction

During bulk upserts, Qdrant accumulates immutable segments and spawns background optimizer workers (`max_indexing_threads`) to merge them into a new HNSW graph while serving live queries from old segments. Transient RSS peaks at `1.8x..2.3x` steady-state collection RAM unless both graph links (`hnsw_config.on_disk`) and optimizer concurrency are constrained.

## Immediate Qdrant REST Fix: `hnsw_config.on_disk` + `int8` Quantization + Thread Cap

```json
PUT /collections/docs
{
  "vectors": { "size": 3072, "distance": "Cosine", "on_disk": true },
  "hnsw_config": { "m": 16, "ef_construct": 100, "on_disk": true },
  "optimizers_config": { "max_indexing_threads": 1, "indexing_threshold": 20000 },
  "quantization_config": {
    "scalar": { "type": "int8", "quantile": 0.99, "always_ram": true }
  }
}
```

## Play 1 64-Bit GPU Cuckoo AMQ Without Segment Compaction OOMs

Voxell Forge replaces CPU HNSW segment-merge spikes with GPU-native retrieval, fitting embeddings, `C_corpus` conditioning, and Max neural reranking (`0.8849 nDCG@10`) inside `< 14 GB` VRAM on a single 24 GB GPU (**$9,995/yr** Dev) or managed Cloud (**$199/mo** Team annual).

## Related Optimization Guides, Calculators & Benchmarks

- **[Vector Quantization Math: FP32 vs FP16 vs INT8 vs Binary vs AMQ](/optimize/vector-quantization-fp32-halfvec-int8-binary-amq/)**
- **[Pinecone vs Qdrant vs pgvector vs Voxell Forge](/compare/pinecone-vs-qdrant-vs-pgvector/)**
- **[Vector Database RAM Calculator](/tools/vector-calculator/)**
- **[Audit Your Docs or GitHub Repo Free](/audit/)**

## Frequently Asked Questions

### Why did Qdrant OOM 10 minutes AFTER my ingestion script finished?

Qdrant accepts fast unindexed writes first and triggers asynchronous HNSW segment compaction in the background once indexing_threshold is crossed.

### What memory headroom does Qdrant recommend above raw vector size?

Without on-disk HNSW and scalar quantization, provision at least 1.5x to 2.0x the raw vector + graph footprint so segment merges never hit container cgroup limits.

---

## Zero-Install Model Context Protocol (MCP) & Keyless Agent Verification

```bash
claude mcp add --transport http voxell-forge https://api.voxell.ai/mcp/try
```

- Keyless Retrieval Bake-Off: `POST https://api.voxell.ai/api/v1/agent/bakeoff`
- Keyless Contradiction X-Ray: `POST https://api.voxell.ai/api/v1/agent/xray`
- Machine-Readable Pricing JSON: `https://voxell.ai/api/v1/agent/pricing.json`
- Full LLM Authority Map: `https://voxell.ai/llms-full.txt`
