It’s a Java heap OOM during the destination phase. Recent reports show MongoDB destination can exhaust heap when copying from the temporary collection to the permanent one because it loads all docs into memory without batching during the final copy step. This has been observed with destination-mongodb 0.2.0 and similar symptoms across jobs: logs show “Migration finished… Copying data from tmp tables to permanent” just before “OutOfMemoryError: Java heap space” ([destination-mongodb OOM copying tmp→perm](
https://github.com/airbytehq/airbyte/issues/45118), [shopify→mongodb case](
https://github.com/airbytehq/airbyte/issues/48735), and the follow‑up proposing a batched copy fix ([issue](
https://github.com/airbytehq/airbyte/issues/48851))). These OOMs happen even when k8s/container memory limits are high, because the Java process’ heap is the bottleneck ([45118](
https://github.com/airbytehq/airbyte/issues/45118), [48735](
https://github.com/airbytehq/airbyte/issues/48735)). What you can do now: - Reduce the per-sync memory pressure: - Use smaller streams/batches (split large tables or exclude very large nested fields temporarily) so the tmp→perm copy moves fewer/lighter documents per run ([48735](
https://github.com/airbytehq/airbyte/issues/48735)). - If possible, avoid extremely large documents (e.g., orders with huge line_items arrays were a trigger in one case) or sync those fields separately ([48735](
https://github.com/airbytehq/airbyte/issues/48735)). - Increase Java heap for the destination job: - Raise the connection’s memory_limit so the destination pod/container can allocate a larger heap (several users set per‑connection resource_requirements to higher GiB; OOMs were still possible if the copy is unbatched, but raising heap may help until a fix lands) ([discussion showing resource tuning attempts](
https://github.com/airbytehq/airbyte/discussions/48348), [similar tuning context](
https://github.com/airbytehq/airbyte/issues/51616)). - Upgrade and track the MongoDB destination: - The root cause is the unbatched copy implementation; a community report proposes batching insertMany during the tmp→perm copy to cap heap usage ([proposed fix description and code sketch](
https://github.com/airbytehq/airbyte/issues/48851)). If/when a connector version includes a batched copy, upgrade to that version to prevent this class of OOM. If you still see OOM with reduced batch sizes and higher memory limits, it’s likely the tmp→perm copy path; monitor the destination logs for “Migration finished… Copying data from tmp tables to permanent” followed by the heap error to confirm ([45118](
https://github.com/airbytehq/airbyte/issues/45118), [48735](
https://github.com/airbytehq/airbyte/issues/48735), [48851](
https://github.com/airbytehq/airbyte/issues/48851)).