linux,

Get memory page size in Linux

May 10, 2022 · 1 min read · Post a comment
Get memory page size in Linux

Memory page, virtual memory page, or just page is the smallest block of memory unit in terms of memory management. The page size is determined by the hardware to be exact the processor. The default value for x86 and x86_64 processors is 4 kB, although some architectures support larger values 8 kB, 16 kB or 64 kB.

You can even use 2 MB page sizes which are not that common but if you are interested just google huge pages. Nonetheless, the OS can allocate more than one page at a time if it needs to. Let me show you how to check your current memory page size by following the steps below.

Prerequisites

  • Linux

Solution

Run the following command:

getconf PAGESIZE

or

getconf PAGE_SIZE

Example output:

4096

Conclusion

Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.