Everytime from what I've been seeing.

I could understand it if only a very minor
increase was witnessed over subsequent calls
but it's every time the process is called.

I can't see that its any of the surrounding code
because if even just comment out the $template->process()
call and leave everything else the same it doesn't jump.

It's almost like the memory that is being used each time
isn't being detected as "free" because it's not being 
reused when the chance arises.

Tony Santucci
2CO Product Development
[EMAIL PROTECTED]
Phone:  1-877-294-0273 x 129
            1-614-921-2450 x 129
Fax:      1-(614 or 866)-921-2451
 


-----Original Message-----
From: Cees Hek [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 22, 2005 12:18 PM
To: [EMAIL PROTECTED]
Cc: [email protected]
Subject: Re: [Templates] Template Process Issue? Leak?


On Tue, 22 Feb 2005 11:43:30 -0500, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:
> I've got a memory leak and I've noticed one thing.
> The memory usage of the scripts seems to increase ( greatly ) 
> with the call to $template->process.  I've done the metrics with 
> the GLibTop module and there is a 1.2 MB jump in the memory 
> size of my process when I call the process method.  This memory 
> never gets released.  Comment out the process call and no jump in 
> memory...no page either but I guess you can't have everything. 

Does it jump by 1.2 Megs everytime you reload the page, or does it only jump
the very first time, and then possibly goes up only slightly on subsequent
requests?

> Even if I call $template->process( emptyfile, {} ) the process memory
> still jumps up and won't release. 
>   
> Is there some way to force it to release or clean itself up?
> Or am I doing something wrong here. 

Processes never return memory that they have been allocated to the OS.  They
reuse the same memory internally, but you will never see a process decrease
in size.  The memory only gets released when the process exits.  Since you
are using mod_perl, the memory only gets reclaimed when the apache child
process exits.

But perl will manage the memory internally, so if you undef a variable, that
memory can be re-used by perl for another variable. 
But the process will not decrease in size.

-- 
Cees Hek

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates





_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to