I have read about huge pages and its the (potential) benefits.

However, I am still confused whether this is mostly beneficial on a server with lots of RAM, or if it can be advantageous on a laptop/desktop with 16 GB RAM.

Also, are there any potential problems with using huge pages on a laptop/desktop?

  • these are likely automatically allocated as needed nowadays anyway. see here – mikeserv Sep 27 '14 at 14:47

I don't think that huge pages are worth the trouble on a typical desktop use. Data in huge pages is very slightly faster to access, but this requires allocating memory in chunks of 2MB at a time (on x86_64, with similar sizes on other architectures). Most applications allocate memory in far smaller chunks.

The two main applications of huge pages in user applications are number crunching programs that allocate huge arrays of numbers, and database software. With most applications, it's rarely worth the trouble writing code that looks up the architecture characteristics (to find out the size and availability of huge pages) and ensures that data structures are allocated in the proper chunk size and alignment.

Linux attempts to allocate huge pages automatically, but that again rarely happens on a typical desktop use, because memory is rarely allocated in sufficiently large chunks.

| improve this answer | |
  • for the purpose of this question, is there any difference between huge pages and transparent huge pages? – Martin Vegter Sep 28 '14 at 11:40
  • @MartinVegter “Transparent huge pages” = “Linux attempts to allocate huge pages automatically” – Gilles 'SO- stop being evil' Sep 28 '14 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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