Skip to content

Commit

Permalink
Use php -d memory_limit=X for worker processes
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Feb 15, 2020
1 parent 0a5cd64 commit 2905d86
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Parallel/ParallelAnalyser.php
Expand Up @@ -183,8 +183,16 @@ private function getWorkerCommand(
InputInterface $input
): string
{
$processCommandArray = [];
foreach ([PHP_BINARY, $mainScript, 'worker'] as $arg) {
$processCommandArray = [
escapeshellarg(PHP_BINARY),
];

if ($input->getOption('memory-limit') === null) {
$processCommandArray[] = '-d';
$processCommandArray[] = 'memory_limit=' . ini_get('memory_limit');
}

foreach ([$mainScript, 'worker'] as $arg) {
$processCommandArray[] = escapeshellarg($arg);
}

Expand Down

0 comments on commit 2905d86

Please sign in to comment.