0

I am well aware on how to drop (e.g. /sbin/sysctl vm.drop_caches=3 ) caches in Linux, but for benchmarking I'd like to do the reverse, fill up the caches up to 100% RAM if possible. How would I do that pragmatically?

Dima
  • 305
  • 1
  • 4
  • 17

1 Answers1

0

Do you want to fill cache or do you want to cache specific data?

The system automatically will fill cache as the system is used, filling it with whatever is needed, and expire those pages as it becomes more useful to either cache something else or use the memory as part of an active process.

If you want to cache specific data so it is in ram ready for fast use, the act of reading it from disk once is normally enough, assuming it doesn't get pushed out of cache by something else before you need it again.

user10489
  • 474
  • 1
  • 2
  • 12