Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to change my kernel's page size from 4KB to 4MB as I have had a large addition of RAM to my computer and I am never running out of anymore.

The idea is that programs requiring large amounts of memory will spend less time on allocating pages. I suppose it would improve performance, and I would like to try.

I can’t find anywhere when running make menuconfig. Is there a way to do that?

share|improve this question
up vote 2 down vote accepted

You probably want to look at Transparent Hugepages. The .config item is CONFIG_TRANSPARENT_HUGEPAGE. Note that enabling this won't give you huge pages automatically. You'll need to set the CONFIG_TRANSPARENT_HUGEPAGE_MADVISE to 'n', in order to make it the default.

Also note that this doesn't allow you to choose an arbitrary page size. I allows to use the huge page size of the architecture. For x86_64 this is 1Mb, see https://en.wikipedia.org/wiki/Page_(computer_memory)#Huge_pages for the full table.

share|improve this answer

The PAGESIZE is set at kernel compile time. That selection is only valid for i386 hardware. If you run a 64-bit system or any other architecture, the page size is 4K and cannot be changed.

share|improve this answer
To verify PAGE_SIZE you can use the command getconf PAGE_SIZE – Mark Stewart Jun 2 at 18:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.