raise_memory_limit() earlier -- resolves OOM on 64-bit platforms

On 64-bit platforms the in-memory footprint of our libraries is quite a bit
larger than usual, and we hit the 8MB default memory limit before we call
raise_memory_limit(). This patch moves raise_memory_limit() and
get_realsize() to setuplib so we can call them earlier, and moves the
call to _before_ we include the libraries.

On AMD64, for MOODLE_17_STABLE the footprint is about 9.5MB. Diet time? :-)
This commit is contained in:
martinlanghoff 2006-12-26 22:48:36 +00:00
parent b8d4068893
commit 76f3815be9
3 changed files with 68 additions and 71 deletions

View file

@ -177,9 +177,11 @@ global $HTTPSPAGEREQUIRED;
$CFG->admin = 'admin'; // This is relative to the wwwroot and dirroot
}
/// Increase memory limits if possible
raise_memory_limit('64M'); // We should never NEED this much but just in case...
/// Load up standard libraries
require_once($CFG->libdir .'/textlib.class.php'); // Functions to handle multibyte strings
require_once($CFG->libdir .'/weblib.php'); // Functions for producing HTML
require_once($CFG->libdir .'/dmllib.php'); // Functions to handle DB data (DML)
@ -188,11 +190,6 @@ global $HTTPSPAGEREQUIRED;
require_once($CFG->libdir .'/deprecatedlib.php'); // Deprecated functions included for backward compatibility
require_once($CFG->libdir .'/moodlelib.php'); // Other general-purpose functions
/// Increase memory limits if possible
raise_memory_limit('64M'); // We should never NEED this much but just in case...
/// Disable errors for now - needed for installation when debug enabled in config.php
if (isset($CFG->debug)) {
$originalconfigdebug = $CFG->debug;