What are huge pages and why does XMRig use them?
Huge pages are larger chunks of memory that help your computer run XMRig more efficiently. XMRig, a mining program commonly used for Monero, uses them to reduce the work your processor does when finding data in memory. That can increase your mining speed without changing the mining calculations themselves.
What makes a page “huge”?
Your operating system divides memory into chunks called pages. On many PCs and servers, a normal page is just 4 KB. A huge page is often 2 MB, though the sizes available depend on your processor and operating system.
Your programs use memory addresses that the processor translates into actual locations in physical memory. The processor keeps recent translations in a small, fast storage area called the translation lookaside buffer, or TLB.
Think of it as a quick-reference address book:
- Small pages need many entries to cover a large amount of memory.
- Huge pages let each entry cover much more memory.
- Fewer missing entries mean fewer trips through the operating system’s memory-mapping tables.
Huge pages do not make your RAM physically faster. They reduce some of the overhead involved in accessing it.
Why this matters for Monero mining
Monero uses RandomX, its mining algorithm—the set of calculations miners perform to help secure the network. RandomX favors processors, or CPUs, and repeatedly accesses data in memory.
Its fast mode uses a dataset of about 2,080 MB. Mapping that much memory with ordinary 4 KB pages requires hundreds of thousands of pages. Using 2 MB pages reduces that number dramatically.
Those frequent memory accesses make address translation especially important. Huge pages help XMRig spend less time handling translations and more time doing useful mining work.
You may see a noticeable improvement in hashrate, the number of mining calculations your computer completes each second. The size of that improvement depends on your CPU, operating system, memory setup, and existing bottlenecks. There is no universal percentage increase.
What XMRig’s huge-page status tells you
XMRig normally tries to use huge pages when they are enabled and available. Its startup messages show whether allocation succeeded. A report showing full huge-page allocation means the relevant memory was successfully backed by huge pages.
If allocation fails, XMRig can generally still mine using ordinary pages, but performance may be lower.
Common reasons include:
- Your mining account lacks the necessary memory permissions.
- Your operating system has not reserved enough huge pages.
- Memory has become fragmented, leaving too few suitable large blocks.
- Other applications are using memory the miner needs.
On Windows, the relevant permission is called Lock pages in memory. On Linux, huge pages may need to be reserved or configured. Follow instructions for your operating system rather than copying commands blindly, especially on a shared server.
Are 1 GB pages better?
On supported Linux systems, XMRig can also use 1 GB huge pages for RandomX. These can provide an additional improvement over 2 MB pages, but the gain is usually smaller than the initial move away from ordinary pages.
They also require more reserved memory. That trade-off may not suit a PC or server running other important workloads. Huge pages also cannot replace adequate CPU cache, memory bandwidth, or cooling.
The bottom line
XMRig uses huge pages to make RandomX’s memory access more efficient. Check its startup allocation report, then compare your hashrate under the same conditions. Treat huge pages as a performance setting—not a guarantee of profitable mining.
