diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 7962015..1b8deee 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -2245,6 +2245,11 @@ function drupal_classloader_register($name, $path) {
  */
 function &drupal_static($name, $default_value = NULL, $reset = FALSE) {
   static $data = array(), $default = array();
+
+  if ($name === NULL && $reset === FALSE) {
+    return $data;
+  }
+
   // First check if dealing with a previously defined static variable.
   if (isset($data[$name]) || array_key_exists($name, $data)) {
     // Non-NULL $name and both $data[$name] and $default[$name] statics exist.
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 61d9fee..acffb3e 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -461,7 +461,9 @@ function install_run_tasks(&$install_state) {
     $task = array_shift($tasks_to_perform);
     $install_state['active_task'] = $task_name;
     $original_parameters = $install_state['parameters'];
+    echo __FUNCTION__, ": before ", $task['function'], ": ", number_format(memory_get_usage() / 1024), " KB", "\n";
     $output = install_run_task($task, $install_state);
+    echo __FUNCTION__, ": after  ", $task['function'], ": ", number_format(memory_get_usage() / 1024), " KB", "\n";
     $install_state['parameters_changed'] = ($install_state['parameters'] != $original_parameters);
     // Store this task as having been performed during the current request,
     // and save it to the database as completed, if we need to and if the
diff --git a/core/includes/install.inc b/core/includes/install.inc
index c2a138c..b774ca4 100644
--- a/core/includes/install.inc
+++ b/core/includes/install.inc
@@ -626,7 +626,14 @@ function drupal_install_system($install_state) {
   // Immediately boot a new kernel into the regular production environment.
   $request = \Drupal::hasRequest() ? \Drupal::request() : FALSE;
 
+  echo __FUNCTION__, ": before shutdown: ", number_format(memory_get_usage() / 1024), " KB", "\n";
+
+  \Drupal::service('kernel')->shutdown();
   unset($GLOBALS['conf']['container_service_providers']['InstallerServiceProvider']);
+
+  echo __FUNCTION__, ": after  shutdown: ", number_format(memory_get_usage() / 1024), " KB", "\n";
+  echo var_dump(drupal_static(NULL)), "\n";
+
   $kernel = new DrupalKernel('prod', drupal_classloader(), FALSE);
   $kernel->boot();
 
@@ -634,6 +641,7 @@ function drupal_install_system($install_state) {
     $kernel->getContainer()->enterScope('request');
     $kernel->getContainer()->set('request', $request, 'request');
   }
+  echo __FUNCTION__, ": after  reboot: ", number_format(memory_get_usage() / 1024), " KB", "\n";
 
   $system_path = drupal_get_path('module', 'system');
   require_once DRUPAL_ROOT . '/' . $system_path . '/system.install';
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 4d57e65..1ca7412 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -193,6 +193,7 @@ public function shutdown() {
     }
     $this->booted = FALSE;
     $this->container = NULL;
+    \Drupal::setContainer(NULL);
   }
 
   /**
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
index 8e452d5..eb2cbfd 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
@@ -1144,6 +1144,7 @@ protected function tearDown() {
    * @see TestBase::prepareEnvironment()
    */
   private function restoreEnvironment() {
+    echo get_class($this), ": before restore: ", number_format(memory_get_usage() / 1024), " KB", "\n";
     // Reset all static variables.
     // Unsetting static variables will potentially invoke destruct methods,
     // which might call into functions that prime statics and caches again.
@@ -1229,6 +1230,7 @@ private function restoreEnvironment() {
     // Restore original user session.
     $this->container->set('current_user', $this->originalUser);
     drupal_save_session(TRUE);
+    echo get_class($this), ": after  restore: ", number_format(memory_get_usage() / 1024), " KB", "\n";
   }
 
   /**
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
index 30a6280..d489d5a 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
@@ -800,8 +800,10 @@ protected function setUp() {
     drupal_settings_initialize();
 
     // Execute the non-interactive installer.
+    echo get_class($this), ": before install: ", number_format(memory_get_usage() / 1024), " KB", "\n";
     require_once DRUPAL_ROOT . '/core/includes/install.core.inc';
     install_drupal($parameters);
+    echo get_class($this), ": after  install: ", number_format(memory_get_usage() / 1024), " KB", "\n";
 
     // Import new settings.php written by the installer.
     drupal_settings_initialize();
@@ -817,7 +819,9 @@ protected function setUp() {
     // Not using File API; a potential error must trigger a PHP warning.
     chmod(DRUPAL_ROOT . '/' . $this->siteDirectory, 0777);
 
+    echo get_class($this), ": before rebuildContainer: ", number_format(memory_get_usage() / 1024), " KB", "\n";
     $this->rebuildContainer();
+    echo get_class($this), ": after  rebuildContainer: ", number_format(memory_get_usage() / 1024), " KB", "\n";
 
     // Manually create and configure private and temporary files directories.
     // While these could be preset/enforced in settings.php like the public
@@ -843,6 +847,7 @@ protected function setUp() {
     $batch = $this->originalBatch;
 
     // Collect modules to install.
+    echo get_class($this), ": before modules: ", number_format(memory_get_usage() / 1024), " KB", "\n";
     $class = get_class($this);
     $modules = array();
     while ($class) {
@@ -857,6 +862,7 @@ protected function setUp() {
       $this->assertTrue($success, String::format('Enabled modules: %modules', array('%modules' => implode(', ', $modules))));
       $this->rebuildContainer();
     }
+    echo get_class($this), ": after  modules: ", number_format(memory_get_usage() / 1024), " KB", "\n";
 
     // Like DRUPAL_BOOTSTRAP_CONFIGURATION above, any further bootstrap phases
     // are not re-executed by the installer, as Drupal is bootstrapped already.
@@ -868,7 +874,9 @@ protected function setUp() {
     // @see _drupal_bootstrap_full()
     // @todo Test-specific setUp() methods may set up further fixtures; find a
     //   way to execute this after setUp() is done, or to eliminate it entirely.
+    echo get_class($this), ": before resetAll: ", number_format(memory_get_usage() / 1024), " KB", "\n";
     $this->resetAll();
+    echo get_class($this), ": after  resetAll: ", number_format(memory_get_usage() / 1024), " KB", "\n";
 
     // Temporary fix so that when running from run-tests.sh we don't get an
     // empty current path which would indicate we're on the home page.
diff --git a/core/modules/toolbar/lib/Drupal/toolbar/Tests/ToolbarAdminMenuTest.php b/core/modules/toolbar/lib/Drupal/toolbar/Tests/ToolbarAdminMenuTest.php
index 082a6a7..4bfe4ba 100644
--- a/core/modules/toolbar/lib/Drupal/toolbar/Tests/ToolbarAdminMenuTest.php
+++ b/core/modules/toolbar/lib/Drupal/toolbar/Tests/ToolbarAdminMenuTest.php
@@ -64,7 +64,9 @@ public static function getInfo() {
   }
 
   function setUp() {
+    echo __CLASS__, ": before parent::setUp: ", number_format(memory_get_usage() / 1024), " KB", "\n";
     parent::setUp();
+    echo __CLASS__, ": after  parent::setUp: ", number_format(memory_get_usage() / 1024), " KB", "\n";
 
     $perms = array(
       'access toolbar',
@@ -99,6 +101,13 @@ function setUp() {
 
     // Store the admin_user admin menu subtrees hash for comparison later.
     $this->hash = $this->getSubtreesHash();
+    echo __CLASS__, ": after  setUp: ", number_format(memory_get_usage() / 1024), " KB", "\n";
+  }
+
+  function tearDown() {
+    echo __CLASS__, ": before parent::tearDown: ", number_format(memory_get_usage() / 1024), " KB", "\n";
+    parent::tearDown();
+    echo __CLASS__, ": after  parent::tearDown: ", number_format(memory_get_usage() / 1024), " KB", "\n";
   }
 
   /**
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 5594dd5..9001d57 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -71,7 +71,7 @@
   exit;
 }
 
-$test_list = simpletest_script_get_test_list();
+$test_list = array_fill(0, 1, 'Drupal\toolbar\Tests\ToolbarAdminMenuTest');
 
 // Try to allocate unlimited time to run the tests.
 drupal_set_time_limit(0);
@@ -487,8 +487,11 @@ function simpletest_script_run_one_test($test_id, $test_class) {
 
   try {
     // Bootstrap Drupal.
+    echo "$test_class: before boot: ", number_format(memory_get_usage() / 1024), " KB", "\n";
     drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE);
+    echo "$test_class: after  boot: ", number_format(memory_get_usage() / 1024), " KB", "\n";
     simpletest_classloader_register();
+    echo "$test_class: after  loader: ", number_format(memory_get_usage() / 1024), " KB", "\n";
     // We have to add a Request.
     $request = \Symfony\Component\HttpFoundation\Request::createFromGlobals();
     $container = \Drupal::getContainer();
@@ -505,6 +508,7 @@ function simpletest_script_run_one_test($test_id, $test_class) {
     $status = ($had_fails || $had_exceptions ? 'fail' : 'pass');
     simpletest_script_print($info['name'] . ' ' . _simpletest_format_summary_line($test->results) . "\n", simpletest_script_color_code($status));
 
+    echo "$test_class: before exit: ", number_format(memory_get_usage() / 1024), " KB", "\n";
     // Finished, kill this runner.
     exit(0);
   }
