Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Bug/Memory leak when using DEBUG mode and assign_by_ref

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
huleboer
Smarty n00b


Joined: 06 Oct 2003
Posts: 3

PostPosted: Thu Jan 01, 2004 4:29 pm    Post subject: Bug/Memory leak when using DEBUG mode and assign_by_ref Reply with quote

I get an error telling me that it have used to much memory when I combine $smarty->assign_by_ref('GLOBALS', $GLOBALS);and smarty debugging mode (both the setting it to on and using the url option ?SMARTY_DEBUG). I've tried bumping up how much ram a script can use to 128 Mb but I still get the error:

[01-Jan-2004 17:14:40] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 3881 bytes) in /u
sr/share/TBWS/3party/Smarty-2.6.0/libs/plugins/modifier.debug_print_var.php on line 29

my index.php file:

<?php
$request_use_auto_globals=true;
$templates_dir="/www/tbws.techbee.no/templates";
$compile_dir="/www/tbws.techbee.no/templates_c";
$plugins_dir="/usr/share/TBWS/php";
require 'Smarty.class.php';
$smarty = new Smarty;
$smarty->template_dir = "$templates_dir";
$smarty->compile_dir = "$compile_dir";
$smarty->assign_by_ref('GLOBALS', $GLOBALS);
$smarty->display('shop/index.tpl');
?>

I doubt very much that it should need more then 128 mb to store all the variables I'm passing along to my smarty functions.

I've tested this with both Smarty 2.6.0 and 2.5.0. I'm using it on a debian machine with precompiled apache/php (apache 1.3.26 and php 4.1.2-6, all latest versions for debian).

Let me know if you need any more info about my envirement.
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu Jan 01, 2004 5:31 pm    Post subject: Reply with quote

yes, that's a dup of this bug. a viable solution is still pending.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
huleboer
Smarty n00b


Joined: 06 Oct 2003
Posts: 3

PostPosted: Tue Jan 06, 2004 8:06 am    Post subject: Reply with quote

Ah... Didn't catch that when I tried searching if someone else had the same problem Smile

Do you know when this would be fixed? Like inn 2.7? I see you said it should be fixed inn 2.6 but I guess it wasn't fixed.. I would really like to have my smarty debug function to time everything and see variables without having to do it manually Smile
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Tue Jan 06, 2004 8:47 am    Post subject: Reply with quote

huleboer wrote:
Do you know when this would be fixed?


i don't know. maybe never. maybe when php can compare references.

i think you are best off if you employ your own modifier.debug_print_var.php that knows about your recursively referenced objects.

you could try to fix it yourself, of course. i'd happily accept patches for that problem.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP