Re: memory exhausted... memory leak?

From: Date: Sat, 25 Jan 2003 10:29:24 +0000
Subject: Re: memory exhausted... memory leak?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-133090@lists.php.net to get a copy of this message
It worked fine till I changed database (just the database-name). Here is the script that is executed untill the line 61: - - - GLOBAL.PHP- - - <?php // Pre-load vars
   $settings            = array();
   $database            = array();
     define('XE_VERSION', '0.03a');
define('XE_BUILD', '2003012319'); // Require important Files require './config.inc.php'; require './libs/error.lib.php'; --------------------------------- - - - CONFIG.INC.PHP - - - <?php
$database['host']             = 'localhost';
$database['port']            = '3306';
$database['name']             = 'XEngine';
$database['user']             = '';
$database['pass']             = '';
$database['type']            = 'mysql3x';
$database['persistent']         = (bool) false;
$database['status']            = 'off';
$settings['template_type']        = 'file';    // Takes only 'file' or 'db'
$settings['pre']            = 'xe_';
?> ------------------------------ - - - ERROR.LIB.PHP - - - <?php class error{ var $cache; var $last; var $show; var $die; function error(){
       $this->cache     = array();
       $this->last     = '';
       $this->show    = 4;
       $this->die    = 1;
             define('XE_FATAL', 0);
       define('XE_ERROR', 1);
       define('XE_WARNING', 2);
       define('XE_MINOR', 3);
       define('XE_NOTICE', 4);
} function set($show=4, $die=1){
       $this->show    = $show;
       $this->die    = $die;
       return true;
} function report($msg, $type){
       global $output;
       if($type <= $this->show){
           $this->cache[]    = $type.'-|-'.$msg;
           $this->last    = $type.'-|-'.$msg;
                     if($this->die >= $type){
               $output->finish();
           }
       }
       return true;
} function show($which='all'){
       $array    = array(
               0        => 'FATAL ERROR',
               1        => 'ERROR',
               2        => 'WARNING',
               3         => 'MINOR ERROR',
               4        => 'NOTICE'
               );
             if($which=='all'){
           foreach($this->cache as $cache){
               $errors = explode('-|-', $cache);
               $type    = $errors[0];
               $msg    = $errors[1];
// line 61                             $return[]    = array($array[$type], $msg);
-------------------------------------------------------------------------- I hope you can help me with this, because (on the same server), just 2 dirs away, the same script is running smoothly... :S - Tularis John W. Holmes wrote:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 35 bytes) in /home/virtual/site8/fst/var/www/html/staff/libs/error.lib.php on line
61
I suddenly got this error on one of my sites, and after rechecking the script, it shouldn't be happenning :S Anyway, I was wondering if this would be a memroy leak? or just some standard notice that I'm taking up too much memory ;)
What were you doing when it happened? ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/


« previous php.general (#133090) next »