title: How to allocate "huge" pages for C++ application on Linux
body: <p>I have a C++ app on Linux which is extremely latency sensitive. My memory usage is around 2GB, so with 4kb pages and 64 TLB entries, I am going to be encountering TLB misses.</p>
  
  <p>I read in the Intel developer manuals the 2MB (or 4MB?) "huge" pages only reduce the number of TLB entries by half, so the increase in memory range offsets the reduction in TLB entries and it would be better for performance.</p>
  
  <p>How do I allocate memory using "huge" pages in a C++ application? Are there any trade-offs I should be aware of?</p>
  
  <p>My Linux is a Red Hat distribution.</p>