Find the answer to your Linux question:
Results 1 to 2 of 2
Hi I have a system with 1GB ram and 4GB Compact flash with slackware 10.1 linux. I have written an application which generates large files (300MB) . So I added ...
  1. #1
    Just Joined!
    Join Date
    Dec 2009
    Posts
    1

    Ram memory decrease during file copy to ide disk

    Hi

    I have a system with 1GB ram and 4GB Compact flash with slackware 10.1 linux.

    I have written an application which generates large files (300MB) . So I added an ide disk of 20GB and my application stores the generated files into ide disk.

    The problem is the ram memory is also used during the write process into disk.The memory is given back when I umount the ide disk .
    I check this by running the top command.

    Altough I have 20GB free disk I cant use it because I run out of memory after writing to disk about the amount of free ram memory.

    What am I doing wrong ? How to explain this behavior?

    Thanks

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,970
    Linux uses available memory for disc cache and i/o buffering. It keeps written data in cache as long as it can in case you want to read the data subsequent to it being written (this is a frequent occurance) in order to provide the best possible performance by avoiding accessing the physical disc if not necessary. When that memory is needed by a program, then it will be released for that purpose. Likewise, when you unmount the disc, all cache being used for it will also be released back to the operating system - which you have seen to be the case.

    Anyway, this is how the system is designed to function, and is not something to be concerned with. However, you also indicate that you run out of memory when writing to disc. The problem may be with your application. Have you tried to increase the amount of swap space available to your system? That will increase the amount of memory available to your application.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...