Index: index.php
===================================================================
RCS file: /cvs/drupal/drupal/index.php,v
retrieving revision 1.91
diff -u -F^f -r1.91 index.php
--- index.php	12 Dec 2006 09:32:18 -0000	1.91
+++ index.php	28 Aug 2007 11:58:32 -0000
@@ -9,6 +9,8 @@
  * prints the appropriate page.
  */
 
+$mem_start = memory_get_usage();
+
 require_once './includes/bootstrap.inc';
 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
 
@@ -34,4 +36,20 @@
 
 }
 
-drupal_page_footer();
\ No newline at end of file
+drupal_page_footer();
+
+$mem_stop = memory_get_usage();
+$mem_total = $mem_stop - $mem_start;
+
+print "Start,$mem_start<br>";
+print "End,$mem_stop<br>";
+print "Total,$mem_total<br>";
+krsort($module_size);
+$module_total = 0;
+foreach($module_size as $bytes => $module) {
+  $module_total += $bytes;
+  print "$module,". $bytes ."<br/>";
+}
+$bootstrap = $mem_total - $module_total;
+print "Modules,$module_total<br>";
+print "Bootstrap,$bootstrap<br>";
Index: includes/module.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/module.inc,v
retrieving revision 1.93.2.2
diff -u -F^f -r1.93.2.2 module.inc
--- includes/module.inc	21 Jul 2007 00:54:18 -0000	1.93.2.2
+++ includes/module.inc	28 Aug 2007 11:58:32 -0000
@@ -10,8 +10,15 @@
  * Load all the modules that have been enabled in the system table.
  */
 function module_load_all() {
+  global $module_size;
+  
+  $module_size = array();
   foreach (module_list(TRUE, FALSE) as $module) {
+    $before = memory_get_usage();
     drupal_load('module', $module);
+    $after = memory_get_usage();
+    $bytes  = $after - $before;
+    $module_size[$bytes] = $module;
   }
 }
 

