Hello all, I am maintaining Perl legacy code where template toolkit is being used to generate a XML file. So we provide the template file, the variables, the template object and the location of the output file(where I want the output to be dumped).This goes to the Perl template toolkit and it provides me with the output file. I believe the toolkit does the magic of parsing the variables and the template for creating the output.(Correct me if i am wrong). Now it all works fine until the input data(the variables) size is too much and my Perl crashes(Perl command line interpreter has stopped working). I have a process explorer where i have observed the memory size and Perl consumes around 1.3 GB before crashing. I am providing the code below. If there is anything else needed kindly let me know as this is my first post here

# Get template object my $tobj = $self->_getTemplateObject(); # Set template variables my $vars = {Testrun => $self, Environment => $environment, RunData => $rundata, Filter => $self->getFilterObject(), }; # If file option was supplied, then output to a file if ($file) { #getTemplateFile - access the template file in correct format if ($tobj->process($self->_getTemplateFile(), $vars, $file)) { return; } }

In reply to perl is crashing due to memory leak when the template toolkit output is being dumped into an output file(xml file) by kimya8

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.