Error Diagnostics // NodeFlow Diagnostics
FATAL ERROR: JS Heap Out of Memory During PDF Chunking
Node.js defaults V8 old-space memory to roughly 2-4 GB depending on container limits. Loading and recursively splitting multi-thousand-page PDFs in one request blows past the V8 ceiling.
Measured Stack Telemetry & Memory Profile
NodeFlow Diagnostics heap snapshots show RecursiveCharacterTextSplitter plus PDF.js buffers retain full raw text strings and Float32 embedding payloads simultaneously in V8 old space. Without --max-old-space-size and batched vector upserts, GC mark-compacts stall and abort the Node process.
| Subsystem / Signal | Measured Target | Operational Impact |
|---|---|---|
| Default Node 20 V8 Limit | ~2,048 - 4,096 MB | Crashes on 2,500+ PDF pages in one batch |
| KVM 2 Safe NODE_OPTIONS | --max-old-space-size=4096 | Leaves 4 GB for Postgres, Redis, and Linux |
| KVM 4 / KVM 8 Safe Cap | 8192 MB / 16384 MB | Handles 10k-20k page ingestion queues |
Step-by-Step Triage & Config Remediation
- Inspect container V8 ceiling: Run node -e "console.log(v8.getHeapStatistics().heap_size_limit / 1048576)" inside the Flowise container.
- Set NODE_OPTIONS below host RAM: Allocate 50-55% of VPS RAM to NODE_OPTIONS=--max-old-space-size so Postgres and Qdrant never starve.
- Split batches to 50-100 pages: Enable MODE=queue or offload document ingestion triggers through Make.com webhooks in chunked batches.
NODE_OPTIONS=--max-old-space-size=8192 MODE=queue WORKER_CONCURRENCY=3
Diagnostic FAQ
Why does Flowise crash even on a 16 GB VPS?
Node.js ignores extra host RAM unless NODE_OPTIONS=--max-old-space-size is explicitly set above the default ~4 GB cap.
Can I set --max-old-space-size=14000 on a 16 GB VPS?
No. Postgres, Redis, Qdrant, and Linux kernel buffers need 4-7 GB outside Node V8 heap or Linux OOM killer will send SIGKILL (Exit 137).