Sunday, October 27, 2013

I was wrong about a Linux "memory leak"

A few posts ago I was concerned about the apparent diminishing of available RAM as reported by checking "/proc/meminfo". But then I added this command to my midnight RAM test:

sudo /sbin/sysctl vm.drop_caches=3

Which causes the system to clear memory that is temporarily held -- just in case some data might be accessed again.

So, adding that command makes the MemFree number accurate, but probably lowers the efficiency of the OS slightly.

Duh. (but of course, the "/proc/meminfo" data is misleading)

1 comment:

  1. Hi, I am having problem with apache2 on my R Pi 3B+...system becomes sluggish after 7-10 days operation. No recursive code at all in my programs. Does cron scheduling the above command will help making things fast again ?

    ReplyDelete