diff -urp drupal-6.0-beta3/includes/form.inc includes/form.inc
--- drupal-6.0-beta3/includes/form.inc	2007-11-19 20:23:28.000000000 +0100
+++ includes/form.inc	2007-12-06 16:42:12.000000000 +0100
@@ -1770,6 +1770,7 @@ function theme_checkbox($element) {
   $checkbox .= 'id="'. $element['#id'] .'" ' ;
   $checkbox .= 'value="'. $element['#return_value'] .'" ';
   $checkbox .= $element['#value'] ? ' checked="checked" ' : ' ';
+  $checkbox .= 'onclick="'. $element['#onclick'] .'" ';
   $checkbox .= drupal_attributes($element['#attributes']) .' />';
 
   if (!is_null($element['#title'])) {
diff -urp drupal-6.0-beta3/modules/system/system.admin.inc modules/system/system.admin.inc
--- drupal-6.0-beta3/modules/system/system.admin.inc	2007-11-16 14:16:50.000000000 +0100
+++ modules/system/system.admin.inc	2007-12-06 18:15:57.000000000 +0100
@@ -604,6 +604,7 @@ function system_modules($form_state = ar
     $form['name'][$filename] = array('#value' => $file->info['name']);
     $form['version'][$filename] = array('#value' => $file->info['version']);
     $form['description'][$filename] = array('#value' => t($file->info['description']));
+    $form['memory'][$filename] = array('#value' => t($file->info['memory']));
     $options[$filename] = '';
     // Ensure this module is compatible with this version of core and php.
     if (_system_is_incompatible($incompatible_core, $files, $file) || _system_is_incompatible($incompatible_php, $files, $file)) {
@@ -1684,6 +1685,22 @@ function system_sql() {
 }
 
 /**
+ * Returns information about the memory usage
+ */
+function system_memory_info()
+{
+  $meminf = array();
+  $meminf['in_use'] = round(memory_get_usage()/1024/1024, 2);
+  $meminf['limit']  = floatval(ini_get('memory_limit'));
+  if ($meminf['limit'] - $meminf['in_use'] < 5.0) {
+    $meminf['state'] = 'error';
+  } else {
+    $meminf['state'] = 'status';
+  }
+  return $meminf;
+}
+
+/**
  * Default page callback for batches.
  */
 function system_batch_page() {
@@ -1918,13 +1935,21 @@ function theme_system_modules($form) {
   }
   ksort($packages);
 
-  // Display packages.
   $output = '';
+  // Display memory usage
+  $meminf = system_memory_info();
+  $output .= t('<div id="meminf" class="messages @state">Memory usage: @mem_in_use of @mem_limit MB.</div>', array('@state' => $meminf['state'], '@mem_in_use' => $meminf['in_use'], '@mem_limit' => $meminf['limit']));
+
+  // Display packages.
   foreach ($packages as $package => $modules) {
     $rows = array();
     foreach ($modules as $key => $module) {
       $row = array();
       $description = drupal_render($form['description'][$key]);
+      $memory_info = drupal_render($form['memory'][$key]);
+      if (strlen($memory_info) > 0) {
+        $memory_info = 'Estimated memory required: ' . $memory_info . ' MB';
+      }
       if (isset($form['status']['#incompatible_modules_core'][$key])) {
         unset($form['status'][$key]);
         $status = theme('image', 'misc/watchdog-error.png', t('incompatible'), t('Incompatible with this version of Drupal core'));
@@ -1948,7 +1973,7 @@ function theme_system_modules($form) {
       }
       $row[] = '<strong>'. drupal_render($form['name'][$key]) .'</strong>';
       $row[] = drupal_render($form['version'][$key]);
-      $row[] = array('data' => $description, 'class' => 'description');
+      $row[] = array('data' => $description, 'class' => 'description', 'title' => $memory_info);
       $rows[] = $row;
     }
     $fieldset = array(
diff -urp drupal-6.0-beta3/modules/system/system.module modules/system/system.module
--- drupal-6.0-beta3/modules/system/system.module	2007-11-21 23:33:30.000000000 +0100
+++ modules/system/system.module	2007-12-06 17:04:54.000000000 +0100
@@ -17,6 +17,8 @@ define('DRUPAL_MINIMUM_APACHE', '1.3'); 
 // Maximum age of temporary files in seconds.
 define('DRUPAL_MAXIMUM_TEMP_FILE_AGE', 1440);
 
+drupal_add_js('misc/memorywarn.js');
+
 /**
  * Implementation of hook_help().
  */
@@ -140,7 +142,7 @@ function system_elements() {
   $type['radios'] = array('#input' => TRUE, '#process' => array('expand_radios'));
   $type['radio'] = array('#input' => TRUE, '#default_value' => NULL, '#process' => array('form_expand_ahah'));
   $type['checkboxes'] = array('#input' => TRUE, '#process' => array('expand_checkboxes'), '#tree' => TRUE);
-  $type['checkbox'] = array('#input' => TRUE, '#return_value' => 1, '#process' => array('form_expand_ahah'));
+  $type['checkbox'] = array('#input' => TRUE, '#return_value' => 1, '#process' => array('form_expand_ahah'), '#onclick' => 'updateMem(this)');
   $type['select'] = array('#input' => TRUE, '#size' => 0, '#multiple' => FALSE, '#process' => array('form_expand_ahah'));
   $type['weight'] = array('#input' => TRUE, '#delta' => 10, '#default_value' => 0, '#process' => array('process_weight', 'form_expand_ahah'));
   $type['date'] = array('#input' => TRUE, '#process' => array('expand_date'), '#element_validate' => array('date_validate'));
