Our application uses t2  (2.14) and experienced out of memory on large iteration. Further look reveal an ever growing 'callers' array.

I wonder if caller removal part of the code might be incorrect. Below is code to push and pop from callers array. Is the pop part not using wrong object to check (should $element be replaced with $component) ?

Our application use one template that includes other templates. a Template object is instantiated once and called 100000 times against different data. At about 50000 iteration we would run out of memory.

Andy

            if (UNIVERSAL::isa($component, 'Template::Document')) {
                $element->{ caller } = $component->{ name };
                $element->{ callers } = $component->{ callers } || [];
                push(@{$element->{ callers }}, $element->{ caller });
            }
 
            ....

            pop(@{$element->{ callers }})
                if (UNIVERSAL::isa($element, 'Template::Document'));

                                                                      ^^^^^^^^

Reply via email to