3

My new kernel has CONFIG_DEVTMPFS enabled, and thus my /dev is mounted as devtmpfs. My old kernel was not using CONFIG_DEVTMPFS, and /dev used to be mounted as plain tmpfs.

Now I have noticed, the size of /dev/ is ridiculously large: 8GB, which is half of my RAM:

df | grep devtmpfs
devtmpfs         devtmpfs  7.8G     0  7.8G   0% /dev

In the past, when my /dev was mounted as tmpfs, the size used to be 10MB

df | grep tmpfs
tmpfs                 tmpfs        10M     0   10M   0% /dev

Seems to me, 10MB is more than enough for /dev. Why does /dev/ allocate 50% of my RAM by default? Where can I change this ?

1

1 Answer 1

6

No, the size of /dev is not 8GB. That's the maximum size. The size that it actually uses in memory is proportional to the used size; memory is allocated as needed.

Linux doesn't have man pages for all filesystems, in which case you should look in the mount man page. But tmpfs does have a man page and it does mention this.

2
  • yes I know, but it could "potentially" grow to up to 8GB. Using 50% of RAM as default size for '/dev' makes absolutely no sense whatsoever. I see no legitimate reason to allow /dev/ bigger than 10MB. So why should I use default value of 8GB ? Dec 25, 2015 at 18:09
  • @MartinVegter Well it will only use as much as it needs... That default is there because there needs to be one. Aug 13, 2019 at 21:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .