Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

How to use (interpret results from) Test::LeakTrace?

by Anonymous Monk
on Dec 11, 2024 at 22:14 UTC ( [id://11163148]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

In Release::Checklist, there's brief recommendation to use Test::LeakTrace as (re-phrasing) "help available to trace memory leaks to prevent crashes with out-of-memory after 4 days for long running process". OK.

use strict; use warnings; use Test::LeakTrace; use Text::CSV_XS 'csv'; leaktrace { csv( in => \'1,2' ); };

This script produces a long list of 'leaks'. So what?

Then an example method_cache.pl, included with distribution, reports 'leaks' as well. I see nothing wrong with the code block. Shouldn't I use code like this?

The Test::LeakTrace is ++-ed and at stage 4 up river. Checking reverse dependencies, there's e.g. List::MoreUtils (up-river itself), but (maybe I'm wrong) dependency on Test::LeakTrace seems auto generated and not actually used.

Replies are listed 'Best First'.
Re: How to use (interpret results from) Test::LeakTrace?
by Anonymous Monk on Dec 11, 2024 at 22:23 UTC
Re: How to use (interpret results from) Test::LeakTrace?
by Anonymous Monk on Dec 12, 2024 at 09:04 UTC

    And yet, "-6" is what the "no_leaks_ok" reports as result <= 0 i.e. the conclusion is drawn there are no leaks. But what are the ones on subsequent calls?

    use strict; use warnings; use feature 'say'; use Test::LeakTrace; use Text::CSV_XS 'csv'; say leaked_count { my $ret = csv( in => \'1,2' ); } for 1 .. 12; __END__ 25 -6 1 1 1 1 1 1 1 1 1 1

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11163148]
Approved by choroba
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (None)
    As of 2025-01-13 09:38 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Which URL do you most often use to access this site?












      Results (28 votes). Check out past polls.