in reply to Re^2: LibXML version
in thread LibXML version

"Im trying to Parse a XML file using the LibXML parser and got out of memory error for a 17 MB file. So I was trying for some other parser to load the file with less memory consumption."

In my experience when someone reports an out of memory problem it often related to their horribly inefficient code, rather than an existing library. Hopefully you have eliminated your code as being the root cause of the problem prior to your current line of investigation.

If you have yet to discover which version of libxml is installed I suggest you speak to your systems administrator, keeping in mind what Tux as told you.

Replies are listed 'Best First'.
Re^4: LibXML version ( XML::LibXML::LIBXML_DOTTED_VERSION(), XML::LibXML::LIBXML_VERSION(), XML::LibXML::LIBXML_RUNTIME_VERSION(), $XML::LibXML::VERSION, )
by Anonymous Monk on Nov 26, 2013 at 12:06 UTC

    If you have yet to discover which version of libxml is installed I suggest you speak to your systems administrator, keeping in mind what Tux as told you.

    Don't bother the nice administrator with stuff you can find out yourself

    $ perldoc XML::LibXML |grep -in version 10: $Version_String = XML::LibXML::LIBXML_DOTTED_VERSION; 11: $Version_ID = XML::LibXML::LIBXML_VERSION; 12: $DLL_Version = XML::LibXML::LIBXML_RUNTIME_VERSION;
    use XML::LibXML; print join "\n", XML::LibXML::LIBXML_DOTTED_VERSION(), XML::LibXML::LIBXML_VERSION(), XML::LibXML::LIBXML_RUNTIME_VERSION(), $XML::LibXML::VERSION, ""; __END__ 2.9.0 20900 20900 2.0014
Re^4: LibXML version
by sathya83aa (Acolyte) on Nov 28, 2013 at 12:48 UTC

    Hi Marto..

    I agree with your point that it may be a inefficient code. Let me give you a snippet here. Please let me know if I'm going wrong somewhere.

    my $xsd_file = XML::LibXML::Schema->new(location => $xsd); my $parser = XML::LibXML->new; my $XML_file = $parser->parse_file($xml); eval { $schema->validate(XML_file) };

    Any suggestion will be highly appreciated.

    Thanks & Regards,

    Sathya V.

      "Let me give you a snippet here."

      Does this snippet reproduce the problem? It could be that your memory problems are caused by code you've not shown us. How do I post a question effectively? explains that you should post a minimal example of code and data which reproduces the problem you experience. Also read Tutorials -> Debugging and Optimization -> Basic debugging checklist. Consider profiling your code with something like Devel::NYTProf.

      Update: It seems you're jumping to conclusions as to the cause of this memory issue. I suggest profiling and debugging to isolate the problem.

Re^4: LibXML version
by sathya83aa (Acolyte) on Nov 29, 2013 at 07:54 UTC

    Nope you are wrong dude

    Apart from these line I have variable declarations and printing somethings. Thats it. This code is being used only for XML validation alone. As well I have debugged the code and found the the Parse_file portion is where I have received the error.

    Thanks & Regards,

    Sathya V.