Commit 66e453aa authored by webchick's avatar webchick

Issue #2503999 by neclimdul, mikeryan, Berdir, catch, andypost: Large volume...

Issue #2503999 by neclimdul, mikeryan, Berdir, catch, andypost: Large volume entity migrations run out of memory
parent d3f9129a
......@@ -511,7 +511,17 @@ protected function attemptMemoryReclaim() {
// First, try resetting Drupal's static storage - this frequently releases
// plenty of memory to continue.
drupal_static_reset();
// Entity storage can blow up with caches so clear them out.
$container = \Drupal::getContainer();
/** @var \Drupal\Core\Entity\EntityManagerInterface $manager */
$manager = $container->get('entity.manager');
foreach ($manager->getDefinitions() as $id => $definition) {
$manager->getStorage($id)->resetCache();
}
// @TODO: explore resetting the container.
return memory_get_usage();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment