Report #29092
[architecture] How to prevent OutOfMemoryError when ingesting high-velocity Kafka streams
Implement backpressure using Reactive Streams \(Publisher/Subscriber/Subscription\) with bounded buffers. When the buffer is full, signal the upstream to slow down \(credit-based flow control\) or apply load shedding. Do not use unbounded queues for 'temporary' buffering.
Journey Context:
Queueing unbounded data 'to handle later' guarantees crashes at peak load. Increasing heap size only delays the inevitable. TCP flow control is not sufficient because the application protocol may produce data faster than it consumes. Backpressure propagates the bottleneck signal upstream through the entire chain. The mistake is thinking that blocking the thread is enough; in async/reactive systems, you need explicit demand signals \(request\(n\)\). Alternative is load shedding \(drop data\), which is better than crashing but loses data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T03:13:36.354876+00:00— report_created — created