bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memory leak in cp


From: Steven Augart
Subject: Re: memory leak in cp
Date: Fri, 31 Oct 2003 15:27:57 -0500


This letter does not make sense to me.   I assume you're not saying that the "cp" process has 1.7GB of memory usage, especially since it would presumably have exited by the time you logged off!  I'm guessing that you're typing "free" and seeing something like:

             total       used       free     shared    buffers     cached
Mem:       1547524    1471868      75656          0     306224     975884
-/+ buffers/cache:     189760    1357764
Swap:      1044216      31668    1012548


and that seeing the above data (which I just produced on my RH system) you would think that there was only 75 MB of RAM available.

The numbers you probably care about are on the second line of numbers, where
you can see that there is actually 1358MB of ram to play with.  Linux makes efficient use of the system's memory.  That memory allocated
to "buffers" and "cached" is available for your programs to use, but in the mean time Linux is keeping around a memory of what it last
saw on the disk or CD, so that it doesn't have to go to the physical medium again the next time you want to look at the same information.

A way to see this is:
        copy a file off of a mounted filesystem from a CD.
        now copy it again.
The second time you perform the copy, the CD won't spin up, and the copy will happen almost instantly.  That's 'cause of the "cached"
information that the Linux memory manager is hanging onto; it might as well do something useful with the memory instead of just
letting it sit there unused the way Microsoft operating systems do.

--Steve Augart






Thomas Diesler <address@hidden>
Sent by: address@hidden

31/10/2003 09.13

       
        To:        address@hidden
        cc:        
        Subject:        memory leak in cp



Hi all,

I use RedHat 9

How did I produce the leak
--------------------------

* copy all RPMS from the distribution CD's 1-3 to ~myhome/download/RPMS
* enable the system monitor (for memory) in the bottom panel
* coy all RPMS (1408 files) to /usr/src/redhat/RPMS
* watch how the memory usage is growing up to 1.7G (my box has 2.0G)

shutting everything down, logout does not help.

thanks
-thomas








_______________________________________________
Bug-coreutils mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/bug-coreutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]