Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I went further and tried the Net::XMPP code:
#!/usr/bin/perl use strict; use warnings; print_size('empty'); use Net::XMPP; print_size("after Net::XMPP"); for (1..10) { my $conn = Net::XMPP::Client->new; print_size('Net::XMPP::Client created'); my $status = $conn->Connect( hostname => 'talk.google.com', port => 5222, componentname => 'gmail.com', connectiontype => 'tcpip', tls => 1, ); print_size('connection started'); $conn = undef; } sub print_size { my ($msg) = @_; my @lines = qx{/bin/ps -e -o pid,ppid,vsize,rss,command | grep ^$$ +}; chomp @lines; foreach my $line (@lines) { my ($pid, $ppid, $vsize, $rss) = split /\s+/, $line; print "VM: $vsize RSS: $rss - $msg\n"; } return; }
The result is
VM: 48596 RSS: 14648 - empty VM: 48596 RSS: 14652 - after Net::XMPP VM: 48808 RSS: 14744 - Net::XMPP::Client created VM: 67920 RSS: 18344 - connection started VM: 67920 RSS: 18344 - Net::XMPP::Client created VM: 68072 RSS: 18408 - connection started VM: 68072 RSS: 18408 - Net::XMPP::Client created VM: 68192 RSS: 18464 - connection started VM: 68192 RSS: 18464 - Net::XMPP::Client created VM: 68192 RSS: 18516 - connection started VM: 68192 RSS: 18516 - Net::XMPP::Client created VM: 68300 RSS: 18572 - connection started VM: 68300 RSS: 18572 - Net::XMPP::Client created VM: 68412 RSS: 18648 - connection started VM: 68412 RSS: 18648 - Net::XMPP::Client created VM: 68516 RSS: 18712 - connection started VM: 68516 RSS: 18712 - Net::XMPP::Client created VM: 68636 RSS: 18784 - connection started VM: 68636 RSS: 18784 - Net::XMPP::Client created VM: 68740 RSS: 18856 - connection started VM: 68740 RSS: 18856 - Net::XMPP::Client created VM: 68848 RSS: 18928 - connection started
So if I understand correctly this means the Net::XMPP::Client is leaking memory? How could I better check it?

In reply to memory leakage by szabgab
in thread memory usage and leakage by szabgab

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (3)
    As of 2018-06-23 20:48 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?



      Results (125 votes). Check out past polls.

      Notices?