diff --git a/.htaccess b/.htaccess
index 7db5d3e..ba5c1cc 100644
--- a/.htaccess
+++ b/.htaccess
@@ -171,3 +171,6 @@ DirectoryIndex index.php index.html index.htm
   # Disable content sniffing, since it's an attack vector.
   Header always set X-Content-Type-Options nosniff
 </IfModule>
+
+php_value memory_limit 128M
+
diff --git a/core/modules/simpletest/simpletest.install b/core/modules/simpletest/simpletest.install
index 9d8e3c7..308810c 100644
--- a/core/modules/simpletest/simpletest.install
+++ b/core/modules/simpletest/simpletest.install
@@ -15,7 +15,7 @@
  *   https://www.drupal.org/node/2289201 and
  *   https://www.drupal.org/node/2307163 and then decrease this limit.
  */
-const SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT = '320M';
+const SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT = '128M';
 
 /**
  * Implements hook_requirements().
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 4e35b28..41f7d11 100644
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -1,5 +1,7 @@
 <?php
 
+ini_set('memory_limit', '128M');
+
 /**
  * @file
  * This script runs Drupal tests from command line.
