Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: perl is crashing due to memory leak when the template toolkit output is being dumped into an output file(xml file)

by Corion (Pope)
on Jan 03, 2019 at 11:53 UTC ( #1227967=note: print w/replies, xml ) Need Help??


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

As already asked on Stackoverflow:

Please help us help you better by giving us more information:

Is the problem related to writing to a file or does the program also crash when writing to the console?

Can you please update your post and show us a short, but full program that reproduces the problem? Most likely, you can return a large but hardcoded/generated object from ->getFilterObject. Also show us a short but representative template file please.

The best approach likely is to not generate the output as one large template string but to output the information piecemeal. This likely means rewriting your code completely.

If you are generating XML, I recommend XML::Compile for producing XML from a Perl data structure, given an XSD that describes the intended output.

  • Comment on Re: perl is crashing due to memory leak when the template toolkit output is being dumped into an output file(xml file)
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1227967]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2021-11-29 18:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?