diff -upN drupal-6.0-beta3/modules/system/system.admin.inc drupal/modules/system/system.admin.inc --- drupal-6.0-beta3/modules/system/system.admin.inc 2007-11-16 14:16:50.000000000 +0100 +++ drupal/modules/system/system.admin.inc 2007-12-05 17:26:22.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' => $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)) { @@ -1907,6 +1908,7 @@ function theme_system_modules($form) { $header[] = t('Name'); $header[] = t('Version'); $header[] = t('Description'); + $header[] = t('Memory usage'); // Pull package information from module list and start grouping modules. $modules = $form['validation_modules']['#value']; @@ -1949,6 +1951,7 @@ function theme_system_modules($form) { $row[] = ''. drupal_render($form['name'][$key]) .''; $row[] = drupal_render($form['version'][$key]); $row[] = array('data' => $description, 'class' => 'description'); + $row[] = drupal_render($form['memory'][$key]); $rows[] = $row; } $fieldset = array( diff -upN drupal-6.0-beta3/modules/system/system.module drupal/modules/system/system.module --- drupal-6.0-beta3/modules/system/system.module 2007-11-21 23:33:30.000000000 +0100 +++ drupal/modules/system/system.module 2007-12-05 17:52:24.000000000 +0100 @@ -49,6 +49,7 @@ function system_help($path, $arg) { } $output .= '
'; $output .= t('It is important that update.php is run every time a module is updated to a newer version.
You can find all administration tasks belonging to a particular module on the administration by module page.
', array('@update-php' => $base_url .'/update.php', '@by-module' => url('admin/by-module'))); + $output .= rate_memory(); return $output; case 'admin/build/modules/uninstall': return ''. t('The uninstall process removes all data related to a module. To uninstall a module, you must first disable it. Not all modules support this feature.') .'
'; @@ -1698,3 +1699,19 @@ function theme_system_powered_by($image_ $image = theme('image', $image_path, t('Powered by Drupal, an open source content management system'), t('Powered by Drupal, an open source content management system')); return l($image, 'http://drupal.org', array('html' => TRUE, 'absolute' => TRUE, 'external' => TRUE)); } + +function rate_memory() { + $mem_in_use = round(memory_get_usage()/1024/1024, 2); + $mem_limit = intval(ini_get('memory_limit')); + $mem_avail = $mem_limit - $mem_in_use; + if ($mem_avail < 5) { + $class = "messages error"; + $help = "