Fatal error: Allowed Memory Size of (X Size) when running drush migrate-upgrade I'm trying to use drupal migration module with drush to migrate a database. I'm getting this error below. 
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /Applications/XAMPP/xamppfiles/htdocs/drupal-eight-iom/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php on line 76

I have already tried editing the memory_limit on php.ini file

memory_limit=5024MB

Not sure what else I need to do in order to make it work. I'm using Drupal 8.4.4

$databases['default']['default'] = array (
  'database' =&gt; 'drupal-eight-iom',
  'username' =&gt; 'root',
  'password' =&gt; '',
  'prefix' =&gt; '',
  'host' =&gt; '127.0.0.1',
  'port' =&gt; '3306',
  'namespace' =&gt; 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' =&gt; 'mysql',
);

$databases['upgrade']['default'] = array (
    'database' =&gt; 'drupal-seven-iom',
    'username' =&gt; 'root',
    'password' =&gt; '',
    'prefix' =&gt; '',
    'host' =&gt; '127.0.0.1',
    'port' =&gt; '3306',
    'namespace' =&gt; 'Drupal\\Core\\Database\\Driver\\mysql',
    'driver' =&gt; 'mysql',
  );


$settings['install_profile'] = 'standard';
$config_directories['staging'] = 'sites/default/config';
$config_directories['sync'] = 'sites/default/files/config_zB_DnNUK68i5Owp5a8FzTiClQfp3d3jrwcy0_HuS1hNCGv9Y_Iva2Ahm8LCH-P0j0M2jwmQAsA/sync';
You need to check for the right php.ini file. Be aware, that drush is using the CLI (command line interface) version of PHP, which might use a different php.ini file than the version used by your web server.

Your above error message states, that the CLI version has a memory limit of 128MB only (which is the default value that might even be used when there is no php.ini file for your PHP version).

In Windows you can find out the used php.ini file - or the folder where it is expected - by typing the following command to your Windows command prompt:

php -i | findstr /c:"php.ini"

In Unix compatible systems you could use grep instead:

php -i | grep "php.ini"