$linuxjunkies
>

transparent huge page

also: THP, hugepages, automatic hugepages

A memory optimization feature that automatically uses large 2MB or 1GB memory pages instead of standard 4KB pages, reducing CPU overhead without requiring application changes.

Transparent Huge Pages (THP) is a Linux kernel feature that dynamically allocates and manages large memory pages (typically 2MB) behind the scenes. Instead of the default 4KB page size, the kernel can combine multiple small pages into larger units, which reduces the number of page table entries needed and improves CPU translation lookaside buffer (TLB) efficiency.

The feature works "transparently" because applications don't need to be modified to benefit—the kernel handles page size management automatically. However, THP can sometimes cause latency spikes or increased memory fragmentation in certain workloads, so it can be disabled or tuned via /sys/kernel/mm/transparent_hugepage/.

Example: A database using 10GB of memory might use approximately 2,560 standard 4KB pages versus 5 huge 2MB pages, significantly reducing page table overhead and improving performance for memory-intensive workloads.

Related terms