Re: [PHP3] out of dynamic memory in yy_create_buffer()

From: Date: Tue, 20 Jun 2000 21:20:03 +0000
Subject: Re: [PHP3] out of dynamic memory in yy_create_buffer()
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-2362@lists.php.net to get a copy of this message
In article <Pine.LNX.4.10.10006151212370.30882-100000@perseusz.cnt.pl>, krzydzie@wp.pl (Krzysztof Dziekiewicz) wrote: > Sometimes I get this fatal error. > Function yy_create_buffer exists in C-code of PHP. It appears when malloc > can't allocate memory. > Lately I get this error on line 2 of my PHP code where was: require("xxxx.inc.php3"). > So there is no more memory to parse the PHP code. > I can't say when it happens. > > What can I do ? > Change configuration of PHP ? > Change configuration of Linux ? > > It funny because there is virtual memory so in what way there is too > little memory ? Virtual memory is not a magic bullet that lets you have as much memory as you want: There's still a physical limit to how much RAM (real and virtual) you have. It is a little odd to run out on line 2, but I guess it depends on what gets included in line 1, and what's in xxxx.inc.php3 Look for near-infinite loops, or nested includes() that include each other recursively, or... If your include() structure is complex, and can't be simplified, do like this in the include file: file: xxxx.inc.php3 <?php if (!defined("xxxx_inc_php3")){ define("xxxx_inc_php3", 1); include "whatever.inc.php3"; //rest of code here. } ?> This guarantees that multiple includes of this file won't do it twice. -- Richard Lynch | If this was worth $$$ to you, buy a CD US Customer Support Director | from one of the artists listed here: Zend Technologies USA | http://www.L-I-E.com/artists.htm http://www.zend.com | (this has nothing to do with Zend, duh!)

« previous php.general (#2362) next »