Fix Guides // NodeFlow Diagnostics
Tuning NODE_OPTIONS=--max-old-space-size Without Triggering Exit 137
Setting --max-old-space-size too low crashes PDF chunking with JS Heap OOM; setting it too high starves Postgres, Redis, and Qdrant into a Linux OOM kill.
Measured Stack Telemetry & Memory Profile
NodeFlow Diagnostics container benchmarks verify that leaving 45-50% of host RAM for co-located databases, Redis workers, V8 off-heap native ArrayBuffers, and Linux page cache gives the highest uptime across 24/7 Flowise deployments.
| Subsystem / Signal | Measured Target | Operational Impact |
|---|---|---|
| Hostinger KVM 2 (8 GB RAM) | --max-old-space-size=4096 | Leaves ~3.9 GB for Postgres + OS |
| Hostinger KVM 4 (16 GB RAM) | --max-old-space-size=8192 | Leaves ~8 GB for Workers + Qdrant + OS |
| Hostinger KVM 8 (32 GB RAM) | --max-old-space-size=16384 | Handles 20k-page ingestion & 60 flows |
Step-by-Step Triage & Config Remediation
- Add NODE_OPTIONS to both Compose and .env: Declare NODE_OPTIONS=--max-old-space-size=8192 explicitly on flowise and flowise-worker services.
- Give workers half of main heap on shared hosts: When running both flowise-main and flowise-worker on KVM 4, size main to 6144 MB and worker to 4096 MB.
- Verify inside running container: Run docker exec flowise-main printenv NODE_OPTIONS to confirm the flag took effect.
environment: - NODE_OPTIONS=--max-old-space-size=8192 mem_limit: 9.0g
Diagnostic FAQ
Does Node.js allocate the full 8192 MB immediately at boot?
No. V8 grows heap usage dynamically up to the cap as PDF chunking or agent arrays demand memory.
What about off-heap PDF buffers in Node.js?
Native Buffers and TypedArrays sit outside V8 old-space, which is why mem_limit should stay ~1 GB above --max-old-space-size.