When 2MB Is Not Enough
On x86_64 hardware, the CPU supports a second HugePage size: 1 Gigabyte (1GB). These are sometimes called Gigantic Pages or 1G pages. They exist for the same reason 2MB pages exist relative to 4KB pages — at extreme scale, even 2MB pages generate too many TLB entries.
The math at 1TB scale:
1TB RAM with 4KB pages: 268,435,456 page table entries
1TB RAM with 2MB pages: 524,288 page table entries
1TB RAM with 1GB pages: 1,024 page table entries
A 512-entry TLB with 1GB pages covers 512GB of RAM — enough for the entire working set of most large in-memory databases to fit in the TLB simultaneously.
The critical constraint — boot-time allocation: Unlike 2MB HugePages, which can be allocated on a running system (with some difficulty), 1GB pages almost always require allocation at kernel boot time. The reason is physical memory fragmentation: finding a contiguous 1GB block of physical RAM on a system that has been running for days is nearly impossible. The kernel's memory allocator has scattered small allocations throughout physical memory, leaving no room for a 1GB contiguous block.
Configuring 1GB pages via GRUB: because they must be reserved at boot, 1GB pages are configured as kernel boot parameters — hugepagesz, hugepages, and default_hugepagesz — added to the bootloader configuration, which then requires regenerating the boot config and rebooting for the change to take effect. Requesting 100 pages at 1GB each this way reserves 100GB of RAM as 1GB HugePages before any other memory allocation occurs.
Verifying 1GB page allocation after boot: the same /proc/meminfo fields confirm it — Hugepagesize now reads 1048576 kB (1GB) instead of the usual 2MB, alongside the total and free page counts.
When to use 1GB pages: Only on servers with 512GB+ RAM running a single dominant workload (a large Oracle database, a massive Elasticsearch cluster, an in-memory analytics engine). The operational complexity — boot-time allocation, inability to resize without rebooting, memory that cannot be reclaimed — makes 1GB pages unsuitable for general-purpose servers.