Hello Perl Monks, I'm trying to load a 290MB XML file using Tk and LibXML. I'm on Windows 7 64bit with 8GB of RAM using strawberry 'perl 5, version 30, subversion 0 (v5.30.0) built for MSWin32-x64-multi-thread'

This is the stripped down version of the script that's been crashing:

use strict; use XML::LibXML; use Tk; my $filename; my $xpc; my $mw = MainWindow->new( -title => 'GUI' ); $mw->Button( -text => 'Load XML', -command => \&tk_Load_Export )->grid +(-column => '0', -row => '0', -sticky => 'e'); MainLoop; sub tk_Load_Export { $filename = $mw->getOpenFile( -title => 'Load XML', -defaultextensio +n => '.xml', -initialdir => '.' ) or return; import_XML($filename); } sub import_XML { print "Reading the XML file $filename\n\n"; my $dom = XML::LibXML->load_xml(location => $filename, huge => 1); $xpc = XML::LibXML::XPathContext->new($dom); print "XML imported\n"; }

After I get 'XML imported' output the script crashes with these 'Perl interpreter stopped working' Windows messages

Problem signature: Problem Event Name: APPCRASH Application Name: perl.exe Application Version: 5.30.0.1 Application Timestamp: 5ce675b5 Fault Module Name: Tk.xs.dll Fault Module Version: 8.4.2.5 Fault Module Timestamp: 5d48325f Exception Code: c0000005 Exception Offset: 000000000006b197 OS Version: 6.1.7601.2.1.0.256.48 Locale ID: 1033 Additional Information 1: 0922 Additional Information 2: 09222532a50de2713b0e459db9ce5206 Additional Information 3: 1a6d Additional Information 4: 1a6d675851be0305a03f72c1d1fc7bfd -- Problem signature: Problem Event Name: APPCRASH Application Name: perl.exe Application Version: 5.30.0.1 Application Timestamp: 5ce675b5 Fault Module Name: Tk.xs.dll Fault Module Version: 8.4.2.5 Fault Module Timestamp: 5d48325f Exception Code: c000041d Exception Offset: 000000000006b197 OS Version: 6.1.7601.2.1.0.256.48 Locale ID: 1033 Additional Information 1: 0561 Additional Information 2: 056116c4c04c02ca22cbeb428d55467a Additional Information 3: dab2 Additional Information 4: dab22cdd161f9720b851e7ce36d909c8

Sometimes but not always I also get this message after 'XML imported' output:

Free to wrong pool 46af30 not 645b4f4a at C:/Strawberry/perl/site/lib/ +Tk.pm line 424.

Is this because of the file size? The script doesn't crash on smaller XML files (~200MB).

Can someone help me understand why this is happening and how do I mitigate this?


In reply to Script using Tk and LibXML crashing by misczol

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.