0

I recently learned that my Ubuntu Linux file system may cache the result of some commands such as searches, sorts, and perhaps build commands such as make.

I run Ubuntu in a VM, and although I have allocated almost 4G of memory to it, after a productive day of re-building, and processing, it seems the VM is very very slow. I can not switch from one environment to the next, which is Windows, and ...

So the reason I post here, is I wonder if some how I can clear these caches without having to restart my VM every time. That is, if in fact, the reason for the slowness is cached items.

0

The filesystem on Linux caches recently accessed files. These caches do not impact performance because they can be invalidated if the memory is needed. It helps the overall performance of the system to use all available pages as a disk cache.

There is no caching of search results (as in, associating a certain command with a certain cached output, so that running the command can be elided if none of its inputs changed). Such things exist, but aren't integrated into Ubuntu.

Your experience is unusual, and sounds a lot like some background process that is using a lot of memory or causing activity. Next time that happens, run the top command to see what is running.

A periodic source of disk activity is the updatedb program that indexes the filesystem for faster searching (this works with the locate command). Ubuntu systems come with this package, and it is scheduled by cron to run daily.

  • @Kaz- Thanks. I'll run top, and the issue may even stem from my host OS, Windows. I got the idea of caching from this very informative article I just read: inmotionhosting.com/support/website/ssh/… . Under "avoiding filesystem caching" – user3326293 Aug 17 '15 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.