Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.110
diff -u -r1.110 install.php
--- install.php	27 Dec 2007 17:25:27 -0000	1.110
+++ install.php	2 Jan 2008 15:50:25 -0000
@@ -887,6 +887,11 @@
   // Check the other requirements.
   $requirements = drupal_check_profile($profile);
   $severity = drupal_requirements_severity($requirements);
+  
+  // If there is a PHP memory limit warning, report it.
+  if (isset($requirements['php_memory_limit']['severity']) && $requirements['php_memory_limit']['severity'] == REQUIREMENT_WARNING) {
+    drupal_set_message($requirements['php_memory_limit']['description'], 'warning');
+  }
 
   // If there are issues, report them.
   if ($severity == REQUIREMENT_ERROR) {
@@ -901,6 +906,7 @@
       }
     }
   }
+
 }
 
 /**
Index: includes/theme.maintenance.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.maintenance.inc,v
retrieving revision 1.5
diff -u -r1.5 theme.maintenance.inc
--- includes/theme.maintenance.inc	8 Dec 2007 15:15:25 -0000	1.5
+++ includes/theme.maintenance.inc	2 Jan 2008 15:45:51 -0000
@@ -125,6 +125,13 @@
     $variables['content'] .= '<p>'. st('Please check the error messages and <a href="!url">try again</a>.', array('!url' => request_uri())) .'</p>';
   }
 
+  // Special handling of warning messages
+  if (isset($messages['warning'])) {
+    $title = count($messages['warning']) > 1 ? st('The following installation warnings should be carefully reviewed.') : st('The following installation warning should be carefully reviewed.');
+    $variables['messages'] .= '<h4>'. $title .':</h4>';
+    $variables['messages'] .= theme('status_messages', 'warning');
+  }
+
   // Special handling of status messages
   if (isset($messages['status'])) {
     $title = count($messages['status']) > 1 ? st('The following installation warnings should be carefully reviewed, but in most cases may be safely ignored') : st('The following installation warning should be carefully reviewed, but in most cases may be safely ignored');
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.222
diff -u -r1.222 system.install
--- modules/system/system.install	31 Dec 2007 17:20:20 -0000	1.222
+++ modules/system/system.install	2 Jan 2008 15:43:28 -0000
@@ -62,6 +62,24 @@
     $requirements['php']['description'] = $t('Your PHP installation is too old. Drupal requires at least PHP %version.', array('%version' => DRUPAL_MINIMUM_PHP));
     $requirements['php']['severity'] = REQUIREMENT_ERROR;
   }
+  
+  // Test PHP memory_limit
+  $requirements['php_memory_limit'] = array(
+    'title' => $t('PHP memory limit'),
+    'value' => ini_get('memory_limit') ? ini_get('memory_limit') : '',
+  );
+  if ($phase == 'install') {
+    if (ini_get('memory_limit') && parse_size(ini_get('memory_limit')) < parse_size(DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)) {
+      $requirements['php_memory_limit']['description'] = $t('Your PHP memory limit is set to %memory_limit. Consider increasing this to %memory_minimum_limit to help prevent memory errors in the installation process. If you have access to php.ini you can usually change this setting there. See the <a href="@url">Drupal requirements</a> for more information.', array('%memory_limit' => ini_get('memory_limit'), '%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT, '@url' => 'http://drupal.org/requirements'));
+      $requirements['php_memory_limit']['severity'] = REQUIREMENT_WARNING;
+    }
+  }
+  elseif ($phase == 'runtime') {
+    if (ini_get('memory_limit') && parse_size(ini_get('memory_limit')) < parse_size(DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)) {
+      $requirements['php_memory_limit']['description'] = $t('Depending on your configuration, Drupal can run with a %memory_limit PHP memory limit. However, a %memory_minimum_limit PHP memory limit or above is recommended, especially if your site uses additional custom or contributed modules. If you have access to php.ini you can usually change this setting there. See the <a href="@url">Drupal requirements</a> for more information.', array('%memory_limit' => ini_get('memory_limit'), '%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT, '@url' => 'http://drupal.org/requirements'));
+      $requirements['php_memory_limit']['severity'] = REQUIREMENT_WARNING;
+    }
+  }
 
   // Test DB version
   global $db_type;
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.573
diff -u -r1.573 system.module
--- modules/system/system.module	26 Dec 2007 19:02:24 -0000	1.573
+++ modules/system/system.module	2 Jan 2008 15:44:29 -0000
@@ -22,6 +22,11 @@
 define('DRUPAL_MINIMUM_PHP',    '4.3.3');
 
 /**
+ * Minimum recommended value of PHP memory_limit.
+ */
+define('DRUPAL_MINIMUM_PHP_MEMORY_LIMIT',    '16M');
+
+/**
  * Minimum supported version of MySQL, if it is used.
  */
 define('DRUPAL_MINIMUM_MYSQL',  '4.1.0');
