I'm wondering if there is any way to specify the size of RAM cache used to store
When I look at
/proc/, I can't find anything about
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Further on you can check the actual RAM+swap use of a tmpfs instance with df(1) and du(1).
So simply use
du (you can also use them for ramfs):
$ df | grep tmpfs tmpfs 205032 1136 203896 1% /run
so 1136 KB is in use.
$ sudo du -s /run [sudo] password for jaume: 1416 /run
so 1416 KB is in use.
du report different sizes. What is happening here and which one is right?
/run has a subfolder called
/run/shm, which is itself a separate tmpfs filesytem (although shown as
$ df | grep run tmpfs 205032 1136 203896 1% /run none 5120 0 5120 0% /run/lock none 512572 280 512292 1% /run/shm
Adding both amounts you get the size reported by
$ expr 1136 + 280 1416
So the whole story is that 2 tmpfs filesystems use 1416 KB.
(Here's another reason why
df outputs may differ.)