From: Patrick Kirsch <pkir...@bookandsmile.de>
> Yes, I do have a problem with that situation.
> There is an (huge) application written in Perl. It includes a couple of
> modules from CPAN and does analyzing stuff. As a result the memory
> footprint is (in my expectation) too high (I mean throwing hardware at
> it does not help anymore :-) ).
> I also tried the weakref module from CPAN, but that implicates a nearly
> rewrite of the whole codebase.

Why do you think weakref would help you? Do you have any cyclic data 
structures that are not getting released? Other than memory leaks 
like that, weakref is not gonna do anything about the memory 
footprint. See Devel::Leak to find out if you have leaks.

> I thought a lot of people are using Perl and they probably did hit the
> memory footprint issue. I searched the mail archives, there was an
> discussion in  ~2002 about this issue, sadly without a solution.

It's hard to give an advice since we do not know what data are you 
dealing with and we have not seen your code, but you might have a 
look at PDL (http://search.cpan.org/search?query=PDL&mode=all)

If you are working with huge strings, make sure you do not make 
unnecessary copies (like by foo( "$var") etc.

If you're working with huge XML files, use a streaming parser, 
XML::Twig or XML::Rules so that you do not end up with a huuuuuge 
object maze created by parsing the whole XML.


In either case, you're most likely wasting your time with the garbage 
collector. Worry about your code.

Jenda

===== je...@krynicky.cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to