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

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Here is a win32 version, perl v5.12.2
#!/usr/bin/perl -- sub print_size { my ( $msg ) = @_; my @lines = qx{pslist -m $$ 2>NUL}; shift @lines for 1..3; chomp @lines; #~ print join "\n", @lines, ""; #~ Name Pid VM WS Priv Priv Pk Faults +NonP Page #~ perl 1052 25348 7220 4504 4512 1977 + 2 33 my %ps; @ps{'Name', 'Pid', 'VM', 'WS', 'Priv', 'Priv Pk', 'Faults', 'NonP', 'Page' } = grep length, split /\s+/, shift @lines; #~ Pri Priority #~ Thd Number of Threads #~ Hnd Number of Handles #~ VM Virtual Memory #~ WS Working Set ------ "Mem Usage" in taskmanager #~ Priv Private Virtual Memory ------ "VM Size" in taskman +ager #~ Priv Pk Private Virtual Memory Peak #~ Faults Page Faults #~ NonP Non-Paged Pool #~ Page Paged Pool #~ Cswtch Context Switches #~ use DDS; Dump(\@lines , \%ps); #~ print "VM: $ps{VM} RSS: $ps{WS} - $msg\n"; print "VM: $ps{VM} < WS: $ps{WS} VM: $ps{Priv} > $msg\n"; } BEGIN { print_size('empty'); } use strict; BEGIN { print_size('strict'); } use warnings; BEGIN { print_size('warnings'); } use Module::Load qw' load '; BEGIN { print_size('Module::Load'); } foreach my $module ( qw[ Module::Loaded Module::Pluggable Time::HiRes Time::Local Time::Piece Time::Seconds Time::gmtime Time::localtime Time::tm Pod::Perldoc Pod::Simple Data::Dumper Scalar::Util Getopt::Long LWP::UserAgent Moose ] ){ load $module; print_size($module); } load POE => qw(Component::Server::TCP); print_size("POE => qw(Component::Server::TCP)"); __END__
VM: 18660 < WS: 2756 VM: 608 > empty VM: 18660 < WS: 2956 VM: 636 > strict VM: 18660 < WS: 3092 VM: 760 > warnings VM: 18660 < WS: 3424 VM: 1024 > Module::Load VM: 18660 < WS: 3644 VM: 1216 > Module::Loaded VM: 20788 < WS: 4520 VM: 2036 > Module::Pluggable VM: 20972 < WS: 5084 VM: 2504 > Time::HiRes VM: 20972 < WS: 5168 VM: 2560 > Time::Local VM: 21020 < WS: 5556 VM: 2928 > Time::Piece VM: 21020 < WS: 5556 VM: 2928 > Time::Seconds VM: 21020 < WS: 5796 VM: 3172 > Time::gmtime VM: 21020 < WS: 5816 VM: 3184 > Time::localtime VM: 21020 < WS: 5816 VM: 3184 > Time::tm VM: 25152 < WS: 6544 VM: 3896 > Pod::Perldoc VM: 25152 < WS: 7660 VM: 4996 > Pod::Simple VM: 25220 < WS: 7996 VM: 5324 > Data::Dumper VM: 25220 < WS: 7996 VM: 5324 > Scalar::Util VM: 25220 < WS: 8404 VM: 5728 > Getopt::Long VM: 25352 < WS: 10188 VM: 7444 > LWP::UserAgent VM: 34232 < WS: 17548 VM: 14592 > Moose VM: 52272 < WS: 22800 VM: 19232 > POE => qw(Component::Server::TC +P)

In reply to Re: memory usage and leakage by Anonymous Monk
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 perusing the Monastery: (10)
    As of 2018-02-20 16:07 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      When it is dark outside I am happiest to see ...














      Results (271 votes). Check out past polls.

      Notices?