Skip to content

How do I resolve the AWS DMS "Last Error Replication task out of memory" error?

3 minute read
0

I want to resolve the "Last Error Replication task out of memory" error that I receive when I run an AWS Database Migration Service (AWS DMS) replication task.

Resolution

Identify the cause of the error

To identify the cause of the "Last Error Replication task out of memory" error, review the AWS DMS task logs.

To resolve this error, complete the resolution that best fits your issue.

Before you make modifications, you must stop your task. After you make the modifications, resume the task. If the task stops during the full load phase, then in-progress tables reload from scratch.

Change the task settings or memory-related parameters

Modify the following task settings or memory-related parameters that require higher memory capacity:

  • Large binary object (LOB) settings
  • Validation parameters, such as ThreadCount and PartitionSize
  • Parallel thread parameters, such as ParallelLoadThreads, ParallelLoadBufferSize, ParallelLoadQueuesPerThread, ParallelApplyThreads, ParallelApplyBufferSize, and ParallelApplyQueuesPerThread
  • Batch apply parameters, such as BatchApplyTimeoutMin, BatchApplyTimeoutMax, BatchApplyMemoryLimit, and BatchSplitSize
  • Other memory-related task settings, such as MinTransactionSize, MemoryLimitTotal, MemoryKeepTime, and StatementCacheSize

For information about the preceding task settings and parameters, see How do I optimize AWS DMS memory usage for migration?

Increase your replication instance class based on your CloudWatch metrics

Check the replication instance's FreeableMemory and SwapUsage Amazon CloudWatch metrics. If FreeableMemory decreases or SwapUsage either increases or fluctuates, then increase the size of your replication instance.

You can also use memory-optimized instances for memory-intensive workloads, such as ongoing migrations and replications of high-throughput transactions.

Split a single task into multiple tasks based on the size of data that's migrated and the amount of memory that's required

If the replication instance has multiple tasks, then you can use the MemoryUsage metric to view the amount of memory that the task consumes. To determine why the task holds memory in the change data capture (CDC) phase, compare CDCChangesMemorySource and CDCChangesMemoryTarget. Troubleshoot the respective endpoint.

When multiple tasks run on the replication instance, take one or more of the following actions:

  • Reduce the number and type of tasks that run on the replication instance.
  • Move the failed task to a different replication instance, and then try again.
  • Increase your replication instance size.

For tasks that have multiple tables that load in parallel or that migrate many tables and schemas, take one or more of the following actions:

  • Reduce the number of tables that you load in parallel.
  • Reduce the number of total tables and schemas that you migrate.
  • Use a different task on a different replication instance to offload the migration of some of the tables and schemas.
  • Increase your replication instance size.

Related information

Target metadata task settings

Change processing tuning settings

Modifying a replication instance