in reply to Re: LibXML version
in thread LibXML version

Hi Marto

Sorry for the vague question I have posted. Let me explain the issue what I'm facing.

I have a AIX server in which Perl and LibXML is installed. 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.

For that I have tried some other parser and got the error "Cant locate ***.al". So my understanding was I might have a older version of LibXML installed. So I need to know the version of the LibXML.

Kindly help me in finding the version of the LibXML. FYI I have tried the options you have mentioned in your reply and nothing came with a output as you have mentioned.

Thanks & Regards

Sathya V.

Replies are listed 'Best First'.
Re^3: LibXML version
by Tux (Canon) on Nov 26, 2013 at 08:45 UTC

    Are both your installed LibXML and perl 64bit builds? One of the problems on AIX is that you cannot see from the presence of a lib if it is a 32bit lib or a 64bit lib.

    If e.g. you are using a 64bit perl build which once worked with a libxml2.a that contained a 64bit set of objects, and then "upgraded" LibXML to a newer version that only shipped a 32bit set of objects (or you installed it by hand and thereby unknowingly removed the 64bit set of objects), then you will not be able to get this to work.

    $ file libxml2.a libxml2.a: archive (big format) $ ar -X32 -tv libxml2.a $ ar -X64 -tv libxml2.a rwxrwxrwx 203/200 2822289 May 12 13:23 2012 libxml2.so.2 $

    In this example, my libxml2.a *only* contains 64bit objects.

    You can check if everything would theoretically be able to load:

    $ perl -MV=XML::LibXML XML::LibXML /pro/lib/perl5/site_perl/5.14.2/aix-64all/XML/LibXML.pm: 2.010 +3 $ ldd /pro/lib/perl5/site_perl/5.14.2/aix-64all/auto/XML/LibXML/LibXML +.so /pro/lib/perl5/site_perl/5.14.2/aix-64all/auto/XML/LibXML/LibXML.so ne +eds: /usr/lib/libc.a(shr_64.o) /pro/local/lib/libxml2.a(libxml2.so.2) /unix /usr/lib/libcrypt.a(shr_64.o) /usr/lib/libiconv.a(shr4_64.o) /usr/lib/libpthread.a(shr_xpg5_64.o) $

    Note the added /auto/. If ldd does not report any problems, chances are you will be able to use XML::LibXML.


    Enjoy, Have FUN! H.Merijn
Re^3: LibXML version
by marto (Cardinal) on Nov 26, 2013 at 10:28 UTC

    "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.

      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

      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.

      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.