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;
}
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|