Why is the page size of the OS 4k, and why does it still remain 4k, because the memory can be quite large?

As far as I know, the page size is 4k in OS memory management. This can be an advantage when the memory is too small. But the memory in our machine is now large enough, why is the page size still 4k? What is the limit for change, which should be like 1M or more?

+4
source share
1 answer

4KB is simply the default page size supported by many architectures.

However, some architectures support the switch to using large page sizes. For example, the i386 supports switching to huge page mode with a page size of 2 MB or 4 MB, and x86_64 supports huge page sizes of 2 MB, and for some new processors it can even support 1 GB page size (large pages).

Many file systems use a block size that is the exact page size or small factor (4K-8K or so). In addition, many operating systems only allocate memory on entire pages. Allocating a 2MB page for each memory allocation request will waste a lot of memory.

+3
source

Source: https://habr.com/ru/post/1484967/


All Articles