Allowed memory size error (Calendar & smarty)

From: Date: Tue, 15 Jun 2004 22:51:54 +0000
Subject: Allowed memory size error (Calendar & smarty)
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11461@lists.php.net to get a copy of this message
Hi -- I'm getting a weird memory limit error when passing an object by assign_by_ref to my template -- but only using one particular object (the other ones pass just fine, this happens to be the biggest, but, at just under 20k, it's not that big). I've described the problem below in as much detail as I could -- has anyone run into this before? Is this some weird memory leak? Am I passing things around incorrectly? ******************** The object I'm passing is an instance of MonthDecorator, adapted from here (http://pearcalendar.sourceforge.net/examples/10.phps) -- basically exactly lifted. Works great in my php scripts before I try to assign it to the template. class MonthDecorator extends Calendar_Decorator { /** * @param Calendar_Month */ function MonthDecorator(& $Month) { parent::Calendar_Decorator($Month); } /** // more stuff here } The code I'm using is this: (I have other code in there where I assign the days to $selection, etc. but didn't seem relevant.) $Month = new Calendar_Month_Weekdays($_GET['y'],$_GET['m']); $MonthDecorator = new MonthDecorator($Month); $MonthDecorator->build($selection); // where selection is array of day objects $t->assign_by_ref("MD", $MonthDecorator); $t->display('tests/cal.tpl'); // where there is nothing happening on cal.tpl yet at all -- i'm just watching the debugger The behaviour is as follows: 1. Often the browser just chokes, displaying: Unable to read URL from host 67.19.16.19: no response from server 2. When it doesn't, either the debug console does not pop up at all (IE6), or it starts writing the debug console on the page (NS7) and then stops with this error: Fatal error: Allowed memory size of 8388608 bytes exhausted at (null):0 (tried to allocate 40 bytes) in /usr/local/psa/home/vhosts/morchand.com/private/plugins/modifier.debug_print_var.php on line 32 *** Other notes are, 1. the template doesn't choke when I send other objects by reference, treats them just fine. 2. If I don't send it to the template, I'm able to use it exactly as I need it -- ie, I've pretty much verified that $MonthDecorator works exactly as I need it from within PHP -- it's when I try to assign it to the template so I can use it there that I run into trouble. 3. print_r($MonthDecorator) shows the object configured as I need it. 4. I've googled this error but haven't come up with much as refers to smarty 5. I changed memory limit in php.ini to 16M from 8M and restarted apached, but behavoiur was same, so I changed it back. Besides, is way less than 8M. ** Because there's an error when it tries to read (null) and it chokes the browser I'm wondering if there's some memory bug in smarty / php I'm hitting? Or is it much simpler than that, something I'm passing incorrectly? Thoughts appreciated, s.

« previous php.smarty.general (#11461) next »