Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Clearing memory

by perrin (Chancellor)
on Apr 13, 2004 at 20:05 UTC ( #344841=note: print w/ replies, xml ) Need Help??


in reply to Clearing memory

If you're concerned about memory, have you checked how much memory the process is using? How much is free on the box? If it goes into swap, that will certainly slow things down.


Comment on Re: Clearing memory
Re: Re: Clearing memory
by eXile (Priest) on Apr 13, 2004 at 21:22 UTC
    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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-12-21 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (102 votes), past polls