AW> That's (probably) not a memory leak. It's TT keeping an in-memory
AW> cache of compiled templates. That's what makes it so much faster.
I was performing those tests with TT2 options:
CACHE_SIZE=>0, COMPILE_EXT=>'.ttc', COMPILE_DIR=>"$TT2Path/.ttc"
and the test script was requesting just one page repeatedly. The more
times that script requests the page, the more memory Apache eats. So I
think this is not in-memory cache. Or cache works somehow strange - at
least on my machine.
This is the "downloader" script:
====================
#!/usr/bin/perl
use LWP::Simple qw();
use Benchmark qw(:all :hireswallclock);
print "Start\n";
my $T1=new Benchmark;
for (my $a=0; $a<100; $a++) {
&LWP::Simple::get('http://127.0.0.1/cgi-bin/script.pl');
}
my $T2=new Benchmark;
print "Done\n";
print timestr(timediff($T2,$T1)),"\n";
====================
Just now I run more tests, and I think I understood how TT2 works. :-)
For now I used memory cache with CACHE_SIZE=>5 (and 32, and 64), and
hungry Apache was gone! :-)
So - $tt2 created on startup is intended for for fast memory caching,
but disk caching is intended only for local $tt2 handlers. :-) Global
$tt2 with disk cache is only a HUGE memory waste.
I think this "feature" must be closely investigated and fixed or
described in manuals.
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates