Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^4: Memory Leak: Uses 3GB+

by kilimanjaro (Initiate)
on Jan 17, 2009 at 15:49 UTC ( [id://737045]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Memory Leak: Uses 3GB+
in thread Memory Leak: Uses 3GB+

Check this out when running valgrind memory test on the previous posted perl script

==28945== Memcheck, a memory error detector. ==28945== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et +al. ==28945== Using LibVEX rev 1878, a library for dynamic binary translat +ion. ==28945== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP. ==28945== Using valgrind-3.4.0, a dynamic binary instrumentation frame +work. ==28945== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et +al. ==28945== For more details, rerun with: -v ==28945== ==28945== ==28945== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 29 from + 2) ==28945== malloc/free: in use at exit: 1,488,425 bytes in 28,258 block +s. ==28945== malloc/free: 47,397 allocs, 19,139 frees, 16,246,146 bytes a +llocated. ==28945== For counts of detected errors, rerun with: -v ==28945== searching for pointers to 28,258 not-freed blocks. ==28945== checked 2,423,200 bytes. ==28945== ==28945== 5 bytes in 1 blocks are definitely lost in loss record 1 of +18 ==28945== at 0x4004A41: malloc (vg_replace_malloc.c:207) ==28945== by 0x34D8E54: Perl_savesharedpv (in /usr/lib/perl5/5.8.5/ +i386-linux-thread-multi/CORE/libperl.so) ==28945== by 0x3486313: (within /usr/lib/perl5/5.8.5/i386-linux-thr +ead-multi/CORE/libperl.so) ==28945== by 0x348A23B: perl_parse (in /usr/lib/perl5/5.8.5/i386-li +nux-thread-multi/CORE/libperl.so) ==28945== by 0x8049339: main (in /usr/bin/perl) ==28945== ==28945== ==28945== 13,767 (1,299 direct, 12,468 indirect) bytes in 14 blocks ar +e definitely lost in loss record 9 of 18 ==28945== at 0x4004A41: malloc (vg_replace_malloc.c:207) ==28945== by 0x34D9BDA: Perl_safesysmalloc (in /usr/lib/perl5/5.8.5 +/i386-linux-thread-multi/CORE/libperl.so) ==28945== by 0x351D46F: Perl_new_stackinfo (in /usr/lib/perl5/5.8.5 +/i386-linux-thread-multi/CORE/libperl.so) ==28945== by 0x3483D8A: Perl_init_stacks (in /usr/lib/perl5/5.8.5/i +386-linux-thread-multi/CORE/libperl.so) ==28945== by 0x34841CB: perl_construct (in /usr/lib/perl5/5.8.5/i38 +6-linux-thread-multi/CORE/libperl.so) ==28945== by 0x80492EE: main (in /usr/bin/perl) ==28945== ==28945== ==28945== 7,472 bytes in 3 blocks are definitely lost in loss record 1 +2 of 18 ==28945== at 0x4006081: realloc (vg_replace_malloc.c:429) ==28945== by 0x34DA8EB: Perl_safesysrealloc (in /usr/lib/perl5/5.8. +5/i386-linux-thread-multi/CORE/libperl.so) ==28945== by 0x351D7C8: Perl_savestack_grow (in /usr/lib/perl5/5.8. +5/i386-linux-thread-multi/CORE/libperl.so) ==28945== by 0x351E42C: Perl_save_I32 (in /usr/lib/perl5/5.8.5/i386 +-linux-thread-multi/CORE/libperl.so) ==28945== by 0x34C3FDB: Perl_pad_block_start (in /usr/lib/perl5/5.8 +.5/i386-linux-thread-multi/CORE/libperl.so) ==28945== by 0x34B24C9: Perl_block_start (in /usr/lib/perl5/5.8.5/i +386-linux-thread-multi/CORE/libperl.so) ==28945== by 0x34AEBA5: Perl_yyparse (in /usr/lib/perl5/5.8.5/i386- +linux-thread-multi/CORE/libperl.so) ==28945== by 0x35295CB: (within /usr/lib/perl5/5.8.5/i386-linux-thr +ead-multi/CORE/libperl.so) ==28945== by 0x352AF7C: Perl_pp_require (in /usr/lib/perl5/5.8.5/i3 +86-linux-thread-multi/CORE/libperl.so) ==28945== by 0x34D7DDC: Perl_runops_debug (in /usr/lib/perl5/5.8.5/ +i386-linux-thread-multi/CORE/libperl.so) ==28945== by 0x3482AE5: (within /usr/lib/perl5/5.8.5/i386-linux-thr +ead-multi/CORE/libperl.so) ==28945== by 0x3488E6A: Perl_call_sv (in /usr/lib/perl5/5.8.5/i386- +linux-thread-multi/CORE/libperl.so) ==28945== ==28945== ==28945== 144,708 bytes in 14 blocks are possibly lost in loss record +17 of 18 ==28945== at 0x4004A41: malloc (vg_replace_malloc.c:207) ==28945== by 0x34D9BDA: Perl_safesysmalloc (in /usr/lib/perl5/5.8.5 +/i386-linux-thread-multi/CORE/libperl.so) ==28945== by 0x34E4DE7: Perl_reentrant_init (in /usr/lib/perl5/5.8. +5/i386-linux-thread-multi/CORE/libperl.so) ==28945== by 0x34843F0: perl_construct (in /usr/lib/perl5/5.8.5/i38 +6-linux-thread-multi/CORE/libperl.so) ==28945== by 0x80492EE: main (in /usr/bin/perl) ==28945== ==28945== LEAK SUMMARY: ==28945== definitely lost: 8,776 bytes in 18 blocks. ==28945== indirectly lost: 12,468 bytes in 27 blocks. ==28945== possibly lost: 144,708 bytes in 14 blocks. ==28945== still reachable: 1,322,473 bytes in 28,199 blocks. ==28945== suppressed: 0 bytes in 0 blocks. ==28945== Reachable blocks (those to which a pointer was found) are no +t shown. ==28945== To see them, rerun with: --leak-check=full --show-reachable= +yes

Replies are listed 'Best First'.
Re^5: Memory Leak: Uses 3GB+
by BrowserUk (Patriarch) on Jan 17, 2009 at 16:10 UTC

    Sorry, but there's no way (for me) to know if that 20k definitely leaked represents something to be concerned about or not.

    It could be that the program will never leak more than that, in which case it's not worth worrying about. Or it could be the start of something bigger. You'd need to put the program in a loop and run it for a while to see what happens over time.

    What is (full) top showing you about your real system?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^5: Memory Leak: Uses 3GB+
by Corion (Patriarch) on Jan 17, 2009 at 16:21 UTC

    That valgrind report does not help. If your program exits normally, then all memory will be reclaimed by the operating system. It might be that Asterisk itself has a problem when launching external processes, or it could launch your script not as an external program but in-process like mod_perl does. I don't know Asterisk, but if your program writes to its own logfile, you might be able to find out whether your program really finishes by adding some strategic BEGIN{} and END{} blocks, or by reading the Asterisk documentation about how it runs AGI scripts (if your script is launched as AGI).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-24 23:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found