Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
From the OP I don't understand if the difference between CPU usage and memory usage is clear to the poster. If this difference is clear I apologize for telling something you already know.

CPU usage and memory usage are seperate entities. This code:
perl -e 'for(;;) { }'
Will use close to 100% CPU-usage while using little memory (for a perl-process at least), this is because the processor is constantly wants a slice of processor time, to execute something close to nothing. In the 'top'-output the memory use is in the SIZE and RES columns:
PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMA +ND 38691 eXile 64 0 2160K 1444K RUN 1:30 92.84% 92.04% perl5 +.8.2
While this code:
perl -e 'for(;;) { sleep 100 }'
will almost use no CPU-cycles, and almost the same amount of memory. Because this process will only ask for processor time every 100 seconds:
PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMA +ND ... 38692 eXile 10 0 2160K 1480K nanslp 0:00 0.00% 0.00% perl5 +.8.2
I think in Win32 the process-manager (or the 'top' provided by cygwin) should be able to display this type of information as well. No experience on other OSses.

In reply to Re: Re: Clearing memory by eXile
in thread Clearing memory by sunadmn

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?

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

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (11)
    As of 2018-04-26 18:25 GMT
    Find Nodes?
      Voting Booth?