diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlFieldableEntityTypeListenerTrait.php b/core/lib/Drupal/Core/Entity/Sql/SqlFieldableEntityTypeListenerTrait.php
index 7ff74ed795693f8b4f1de658352398eed3ffb880..f9a1a9c33f42701bf4cc4878f8c817e51b75082f 100644
--- a/core/lib/Drupal/Core/Entity/Sql/SqlFieldableEntityTypeListenerTrait.php
+++ b/core/lib/Drupal/Core/Entity/Sql/SqlFieldableEntityTypeListenerTrait.php
@@ -224,6 +224,9 @@ protected function copyData(EntityTypeInterface $entity_type, EntityTypeInterfac
       $sandbox['current_id'] = $identifier;
     }
 
+    // Reset the cache in order to free memory as we progress.
+    \Drupal::service('entity.memory_cache')->deleteAll();
+
     // Get an updated count of entities that still need to migrated to the new
     // storage.
     $missing = $this->database->select($table_name, 't')