Ekaterina Volkova
10/29/2026, 12:45 PMairbyte/source-mongodb-v2:2.0.7 is failing once in a while with "Terminating due to java.lang.OutOfMemoryError: Java heap space" error. Data volume of a single sync does not drift much. Full refresh always finishes successfully. What could be be an underlying issue?kapa.ai
10/29/2026, 12:45 PMOutOfMemoryError: Java heap space during incremental (CDC) syncs — while Full Refresh always succeeds — points strongly to large MongoDB change stream events overwhelming the connector's in-memory queue. There is a directly relevant fix in the knowledge sources: pull request #82138 describes exactly this scenario: > Large MongoDB change events can exhaust the JVM heap when a smaller configured queue is silently expanded to 1,000 entries. In version 2.0.7 (and earlier), the connector had a queue floor of 1,000 entries regardless of what you configured. If individual CDC change events are large (e.g., documents approaching the 16MB BSON limit), holding 1,000 of them in memory simultaneously can exhaust the heap — intermittently, depending on which documents happen to be changing at sync time. [PR #82138] This also explains why: • Full Refresh always succeeds — it reads documents directly without using change streams, so it isn't subject to this queue behavior. • It's intermittent — it depends on which large documents are being changed at the time of the sync. Recommended Actions 1. Upgrade the connector. Version 3.0.0 (released 2026-10-27) is a major rewrite that replaces Debezium with the native MongoDB driver for change streams, which fundamentally changes how CDC events are processed. [MongoDB changelog] 2. If you must stay on 2.x, check whether your MongoDB documents are large (approaching 16MB). If so: ◦ Switch affected streams to Full Refresh mode to avoid change streams entirely. ◦ Restructure large documents to stay well under the 16MB BSON limit. ◦ Deselect streams containing very large documents. [MongoDB CDC Limitations] 1. Review the queue_size configuration (available in 2.x) — lowering it reduces the number of large events held in memory simultaneously, though note this setting was removed in 3.0.0. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.