XML::Simple - memory leak?

Discussion in 'Perl Misc' started by Joe Casadonte, Jun 21, 2004.

  1. I've got a simple script, that consumes enormous amounts of memory:

    while (<IN>) {
    chomp;

    next unless m{sampleResult};

    my($xml) = eval { XMLin($_, %SIMPLE_OPTS); };
    if ($@) {
    warn qq(Malformed XML - $fname: $. - $@\n);
    next;
    }

    $xml = undef;
    }

    close IN;

    Underlying XML::Simple is XML::Sax::Expat, and of course it's possible
    (probable?) that the problems lies somewhere below XML::Simple. It
    happens with or without the eval, so that's not an issue.

    ===
    This is perl, v5.8.0 built for MSWin32-x86-multi-thread
    (with 1 registered patch, see perl -V for more detail)

    Copyright 1987-2002, Larry Wall

    Binary build 804 provided by ActiveState Corp. http://www.ActiveState.com
    Built 23:15:13 Dec 1 2002
    ===
    perl -MXML::Simple -e "print $XML::Simple::VERSION"
    1.06

    (that's the latest version available via 'ppm' -- maybe that's my issue?)
    ===

    Any help would be appreciated. Thanks!

    --
    Regards,

    joe
    Joe Casadonte


    ------------------------------------------------------------------------------
    Llama Fresh Farms => http://www.northbound-train.com
    Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
    Perl for Win32 => http://www.northbound-train.com/perlwin32.html
    Emacs Stuff => http://www.northbound-train.com/emacs.html
    Music CD Trading => http://www.northbound-train.com/cdr.html
    ------------------------------------------------------------------------------
    Live Free, that's the message!
    ------------------------------------------------------------------------------
    Joe Casadonte, Jun 21, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott Niu
    Replies:
    7
    Views:
    871
    pavan_2804
    Aug 4, 2006
  2. s.subbarayan

    Dynamic memory allocation and memory leak...

    s.subbarayan, Mar 18, 2005, in forum: C Programming
    Replies:
    10
    Views:
    675
    Eric Sosman
    Mar 22, 2005
  3. cham
    Replies:
    5
    Views:
    753
  4. Mark Probert
    Replies:
    4
    Views:
    315
    Mark Probert
    Feb 9, 2005
  5. Replies:
    10
    Views:
    190
    Yukihiro Matsumoto
    Aug 29, 2006
Loading...

Share This Page