in reply to memory sieve discovery

Do you have examples of some of these "leaks"? If they are in Exporter, is perhaps assigning to a glob a leak?

Replies are listed 'Best First'.
Re^2: memory sieve discovery
by Pstack (Scribe) on Jan 19, 2008 at 05:08 UTC

    Here are some others:

    651 /usr/lib/perl5/5.8.7/File/Path.pm line 121

    582 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 143

    2947 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 2303

    1834 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 1420

    1472 /usr/lib/perl5/site_perl/5.8.7/HTML/TableExtract.pm line 1020

    747 /usr/lib/perl5/site_perl/5.8.7/HTTP/Message.pm line 9

    849 /usr/lib/perl5/site_perl/5.8.7/LWP.pm line 10

    709 /usr/lib/perl5/site_perl/5.8.7/LWP/Protocol/http.pm line 416

    1210 /usr/lib/perl5/site_perl/5.8.7/OLE/Storage_Lite.pm line 11

    1194 /usr/lib/perl5/site_perl/5.8.7/OLE/Storage_Lite.pm line 712

    2202 /usr/lib/perl5/site_perl/5.8.7/Regexp/Common.pm line 36

    3924 /usr/lib/perl5/site_perl/5.8.7/Spreadsheet/ParseExcel.pm line 1929

    1793 /usr/lib/perl5/site_perl/5.8.7/Spreadsheet/ParseExcel/Utility.pm line 11

    1433 /usr/lib/perl5/site_perl/5.8.7/Spreadsheet/WriteExcel/Formula.pm line 25

    2465 /usr/lib/perl5/site_perl/5.8.7/Spreadsheet/WriteExcel/Workbook.pm line 25

    1311 /usr/lib/perl5/site_perl/5.8.7/URI/http.pm line 6

    1012 /usr/lib/perl5/site_perl/5.8.7/i686-linux/BerkeleyDB.pm line 1441

    551 /usr/lib/perl5/site_perl/5.8.7/i686-linux/Compress/Zlib.pm line 16

    253 /usr/lib/perl5/site_perl/5.8.7/i686-linux/HTML/Entities.pm line 150

    523 /usr/lib/perl5/site_perl/5.8.7/i686-linux/HTML/HeadParser.pm line 74

    The leading number in this sample is just the leak count within 1 run of the application -- a batch process. And as I say, I dont know what, if any, significance to attach. Perhaps Exporter is excused, for instance, if globalising is considered "leaky" by definition. And so on.

    Pstack

      I think at least part of this report is exaggerated. Devel::LeakTrace::Fast says that most of its reporting starts at INIT time to circumvent problems with symbol table aliasing. But the "early" reports for example for HTTP::Message (line 9) come because HTTP::Message uses require instead of use to load Carp.pm. My guess is that all modules by Gisle Aas , most notably all modules comprising LWP, will follow the same allocation pattern (that is, URI::http, LWP). Most likely, others will also follow this pattern.

      I think to separate the wheat from the chaff of the leaks reported by Devel::LeakTrace::Fast, you will have to write code that runs a small loop exercising exactly the code where the leak is reported, and then watch that program to see whether it grows beyond bounds or not. As another example, line 25 of SpreadSheet::WriteExcel::Formula seems to be the @ISA assignment - while that's using up memory, it's not generally considered a leak because that memory is still reachable.

        Going on what hipowls says above, and despite the inner concerns raised as a side issue, I believe Perl is squarely eliminated from my own more pressing problem. When I can return to cleaning up those 80 holes of mine I will be keeping your suggestions in mind, and will clearly have my hands full for a while.

        cheers

      File::Path is pure-Perl, no XS components, so I'm hard pressed to explain what its leak might be.

      You could install the latest version and if the problem persists, file a bug report. I have a feeling, however, that your problem is more likely to be a coding style that happens to prevent temporaries from being freed at an appropriately early moment.

      • another intruder with the mooring in the heart of the Perl

        ok v2.04 now installed (over v1.07). It will be a week, however, before it is run again in the same context. I guess the same may apply to many others too!
      I wouldn't give any credence to a report that says that Math::BigInt leaks memory.

      Cheers,
      Rob
        Sure seems unlikely. The full list for Math::BigInt is:

        582 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 143
        36 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 178
        4 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 188
        5 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 189
        5 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 190
        14 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 197
        27 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 215
        18 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 229
        1 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 23
        2947 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 2303
        3 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 24
        18 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 243
        2 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 2437
        2 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 2441
        16 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 2503
        546 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 2628
        8 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 2639
        27 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 268
        38 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 29
        53 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 325
        46 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 366
        104 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 431
        22 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 448
        112 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 519
        144 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 627
        55 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 661
        321 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 850
        52 /usr/lib/perl5/5.8.7/Math/BigInt.pm line 907
        8 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 108
        52 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 122
        1 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 124
        1 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 136
        167 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 138
        1834 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 1420
        13 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 149
        269 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 1626
        57 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 1661
        62 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 1697
        13 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 1931
        19 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 3
        3 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 4
        370 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 9
        4 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 92
        4 /usr/lib/perl5/5.8.7/Math/BigInt/Calc.pm line 93