Hi I'm using CGI::Application::Plugin::Anytemplate with HTML::Template::Expr for an application, and it uses a heck of a lot of memory. Because my code is spread over a number of packages, I'll summarise my logic in pseudo-code:
sub publish_all { foreach my $content_id ($self->get_content_ids()) { $self->publish_article($content_id) } } sub publish_article { my ($self, $content_id) = @_; my %content = $self->get_content($content_id); my $template = $self->template->load( file => $self->get_template($content{template}) ); $template->param(%content); write_to_file_system(${$template->output}); 1; } As I loop through "publish_article", the memory goes up the more times it is called. No globals are defined in my modules. Trying to track down memory usage in Perl can be hard. Running Devel::FindGlobals, I see that the reported size for $HTML::Template::Expr::PARSER is 100,039,491 bytes after publishing 500 articles! Assuming that the stats are correct, how can I keep $PARSER down to a minimal size? BTW. For my test, I invoked the app via the OS command line not through the web server Dan Horne ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 _______________________________________________ Html-template-users mailing list Html-template-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/html-template-users