in reply to Re^6: XML::Twig loves to eat my memory
in thread XML::Twig loves to eat my memory

How can I tell if Scalar::Util is properly installed. Here is the perl I'm using and a check for the Scalar::Util module.
C:\Users\mmitchell>perl -v

This is perl, v5.10.0 built for MSWin32-x86-multi-thread
(with 9 registered patches, see perl -V for more detail)

Copyright 1987-2007, Larry Wall

Binary build 1005 290470 provided by ActiveState http://www.ActiveState.com
Built May 24 2009 12:17:36

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.


C:\Users\mmitchell>perl -e "use Scalar::Util"

C:\Users\mmitchell>
I did as almut suggested and ran the process() function twice.
Size after first process() 
167,472 MB
Size after second process()
316,212 MB
It seems memory is not "freed" or its just not available for re-use for some reason.

Replies are listed 'Best First'.
Re^8: XML::Twig loves to eat my memory
by ikegami (Patriarch) on Jul 23, 2010 at 15:39 UTC
    It doesn't matter since you're calling dispose, but the relevant test is to call Scalar::Util's weaken
      Can you advise me how to use weaken in my example? I Tried to add weaken($t) after calling $t->dispose() but nothing changed, memory use remained the same. I also tried to call weaken($t) after $t= new XML::Twig but that simply made the XML::Twig object break, it failed on the next method call.
        Twig uses weaken so you don't have to call dispose. Don't call weaken. There does appear to be a memory leak, so you should be submitting a bug report.
Re^8: XML::Twig loves to eat my memory
by toolic (Bishop) on Jul 23, 2010 at 14:49 UTC
    How can I tell if Scalar::Util is properly installed.
    Scalar::Util is a core module for 5.10.0. If perl is correctly installed, than so should this module.
      It's not installed properly on some linux distros.