Skip to content
Snippets Groups Projects
Commit 0f41ffde authored by Daniel Chadwick's avatar Daniel Chadwick Committed by Wim Leers
Browse files

Issue #3421640 by Wim Leers, dan612: Adjust hardcoded memory limit in...

Issue #3421640 by Wim Leers, dan612: Adjust hardcoded memory limit in getClusteredMigrationPlugins()
parent 4bbc3329
No related branches found
No related tags found
1 merge request!353421640: Adjust memory limit logic to allow overriding.
Pipeline #96613 canceled
......@@ -13,6 +13,7 @@ use Drupal\acquia_migrate\Clusterer\Heuristics\HeuristicWithSingleClusterInterfa
use Drupal\acquia_migrate\Clusterer\Heuristics\IndependentHeuristicInterface;
use Drupal\acquia_migrate\Clusterer\Heuristics\LiftingHeuristicInterface;
use Drupal\Component\Assertion\Inspector;
use Drupal\Component\Utility\Bytes;
use Drupal\Core\DependencyInjection\ClassResolverInterface;
use Drupal\migrate\Exception\RequirementsException;
use Drupal\migrate\MigrateBuildDependencyInterface;
......@@ -292,8 +293,12 @@ final class MigrationClusterer {
// Computing all clusters is very resource-intensive. For complex source
// sites, the number of dependencies between migration plugins to analyze to
// compute the appropriate clusters can be very high. Increase the memory
// limit for the remainder of this request.
ini_set('memory_limit', '512M');
// limit for the remainder of this request if not above 512 MB.
$minimum_memory_limit_mb = 512;
$current_memory_limit = Bytes::toNumber(ini_get('memory_limit'));
if ($current_memory_limit < ($minimum_memory_limit_mb * 1024 * 1024)) {
ini_set('memory_limit', $minimum_memory_limit_mb . 'M');
}
$all_migration_plugins = $this->getAvailableMigrationPlugins();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment