Memory loss while copying a file to a mounted partition...

Submitted by gbnaidu
on September 8, 2005 - 3:19am

Hi,

Oflate, I have noticed some thing unusual.

I have copied a huge file (> 1 MB) from one partition (/) to another mounted partition. The strange thing is that after the successful copy, I have seen a loss of main memory in the order of 50KB to 1MB. I have observed MemFree from /proc/meminfo getting decreased each time I do a copy.

Why should main memory be lost when copying is being done to a different mounted partion?

Details of my system:

System Details:
Linux 2 2.4.20 mips unknown

Appreciate your valuble inputs.

TIA
--gb

file still in cache

strcmp
on
September 8, 2005 - 4:17am

There ist no point in watching the MemFree number, this free memory is memory the kernel has found no use for. But there are many uses for memory and the kernel is not supposed wasting your expensive memory by just ignoring it, but to use it for useful things, even for minor benefits.

One of the useful things is relieving the hard disk from work, by storing the results of read operations the disk did, to satisfy further requests for the same data with this previous results. If no one is interested in the data, it can be simply dropped, if better uses for the memory are coming up, no harm done.

This is called caching. The file you copied is still held in cache.

How to know the available free memory (RAM) in Linux...

gbnaidu
on
September 9, 2005 - 5:30am

Thanks a lot for your clarification.

How do I know what is the avaialble free memory? Is there a command/proc file that could help to know this?

What I would like to do is depending on the available free memory, I would like to start some applications or downloading of some data. Normally Linux kills some processes when it runs low of memory. What is the threshold amount beyond which killing of the processes starts?

Thanks
--gb

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.