Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Release Cache Memory

    Anyone have a solution to release cache memory as it is built up by a DMA transfer application? I collect file sizes of ~ 77 MB each hour using 1 GB memory on my system. My data output is interupted and drops data when the OS begins to run low on free memory, which is building up in cache from previous runs. I would think there would be a simple command to release cache after each of my runs, to place in the batch file used for acquisition, but there is nothing I can find. There is shareware for Windows called ReleaseRam that does this for that OS, but nothing that I can find for Linux. Any suggestions?

  2. #2
    Linux Engineer
    Join Date
    Apr 2005
    Well, unfortunately I have the same problem... 1 freaking GB of RAM, and i see the usage climb steadily, until it starts swapping .
    Debian Jessie x86_64 & armhf :: LibreELEC is the solution for your Linux-based HTPC setups.

  3. #3

    Release Cache Memory

    As the C-code that is causing the problem was just recently developed, by
    CS students working the problem for me, I found that they did not include
    a very important C-call upon completing the acquisition. In addition to
    allocateBuffers, one must call releaseBuffers after the last aquisition
    completion to tell the OS to do just that. Am trying to incorporate this solution. Description can be found at:

  4. $spacer_open
  5. #4
    Just Joined!
    Join Date
    Jun 2007
    Hi All,

    For releasing cached memory in Linux , you can use the command specified below.

    sync; echo 3 > /proc/sys/vm/drop_caches

    If you need to execute this command frequently, you can add it as cron job.

    Note: Sync is used to synchronize the data in the memory to disk, as some data in disk might be cached in the memory for easy access. Use of sync will prevent any sort of data loss or file system corruption.

    Tip: Normally, cached memory will not affect the normal working of the system as when genuine program needs memory, it will use the RAM space used for caching.

    Hope this helps. Thank you.

    With Best Regards,
    Abhilash V Nair
    Last edited by oz; 03-24-2011 at 12:59 AM. Reason: Spam Removal

Posting Permissions

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