diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlFieldableEntityTypeListenerTrait.php b/core/lib/Drupal/Core/Entity/Sql/SqlFieldableEntityTypeListenerTrait.php index 7ff74ed795..f9a1a9c33f 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')