What it is
Every memory access needs a virtual-to-physical translation, cached in the TLB. A TLB with 64 entries of 4 KiB pages reaches only 256 KiB; the same 64 entries of 2 MiB pages reach 128 MiB, which is why huge pages help programs with large, scattered working sets. A miss costs a page-table walk of several memory references. This lab simulates a set-associative TLB with LRU on your access pattern and compares the three x86-64 page sizes.
When to use it
Use it to explain the benefit side of transparent huge pages, to see how access pattern and associativity change the hit rate, or to judge whether a working set is likely to fit the TLB reach.
Gotchas & limits
Real CPUs keep separate TLB arrays per page size, a second-level TLB and page-walk caches, so absolute hit rates are illustrative; compare the page sizes with each other. The simulation is not verified against hardware counters (a VM usually has none) and stays a teaching model.