How many huge pages does RandomX need?
For XMRig mining Monero with RandomX, budget 1,168 huge pages of 2 MiB each for one full-memory setup, plus about one page per mining thread. That covers the shared dataset and cache, then each thread’s working memory; multiple CPU memory nodes can increase the total.
Where the 1,168 pages come from
A huge page is a larger-than-usual block of memory managed by your operating system. It helps XMRig use memory more efficiently. It does not mean a blockchain page or a mining job.
With the usual 2 MiB huge-page size, RandomX’s main memory allocations are:
- Dataset: 2,080 MiB, requiring 1,040 huge pages. This is the large collection of data used during mining.
- Cache: 256 MiB, requiring 128 huge pages. XMRig uses this memory to build the dataset.
- Combined: 2,336 MiB, requiring 1,168 huge pages.
MiB means mebibytes, a memory unit slightly larger than a decimal megabyte. The exact units matter when you divide memory into pages.
You may therefore see XMRig report 1168/1168 for its shared RandomX memory. That is not necessarily the total for the whole miner.
Add one page per mining thread
A mining thread is one worker running on your CPU. Each RandomX thread needs a 2 MiB scratchpad, its own temporary working area.
With 2 MiB huge pages, that adds approximately one page per thread:
- 4 threads: 1,172 pages.
- 8 threads: 1,176 pages.
- 16 threads: 1,184 pages.
These are calculated totals for one dataset and cache, not universal operating-system settings. Reserving a little extra can help if another program also uses huge pages.
XMRig may show the shared memory allocation and the thread scratchpads on separate log lines. Check both before assuming that every allocation has huge-page coverage.
When your page count changes
Your system’s layout matters. NUMA, short for non-uniform memory access, means different CPU groups have their own nearby memory. XMRig can create extra datasets to keep mining workers close to their data.
Each additional 2,080 MiB dataset adds 1,040 standard huge pages. Cache allocation and thread counts also affect the final requirement, so use XMRig’s startup output to confirm your actual total.
There are two other important exceptions:
- Light mode: RandomX uses the 256 MiB cache instead of the full dataset. That means 128 shared huge pages, plus thread memory, but mining is much slower.
- 1 GiB pages: On supported Linux setups, XMRig can use three 1 GiB pages per dataset. Cache and thread memory still need separate accounting.
The bottom line
For a typical single-dataset XMRig setup, start with 1,168 two-mebibyte huge pages, plus one per thread. Huge pages improve performance, but RandomX can run without them. Check XMRig’s huge-page allocation messages rather than treating one number as correct for every computer.
