7-Zip Large Pages Support on Windows

7-Zip explicitly supports Large Pages memory allocation on Windows, providing measurable performance improvements during data compression and decompression. This feature allows 7-Zip to allocate memory blocks in sizes of 2 MB or larger instead of the operating system's standard 4 KB pages. By utilizing larger page sizes, 7-Zip significantly reduces virtual memory lookup overhead, leading to faster processing speeds when utilizing memory-intensive algorithms like LZMA and LZMA2.

How Large Pages Improve 7-Zip Performance

During high-compression tasks, 7-Zip frequently accesses large dictionaries in RAM (often several hundred megabytes to several gigabytes). Under default Windows settings, memory is mapped using 4 KB pages. Navigating this vast number of pages causes frequent Translation Lookaside Buffer (TLB) misses, forcing the CPU to repeatedly query physical memory tables.

Enabling Large Pages increases the page size to 2 MB (or higher, depending on CPU architecture). This drastically reduces the total number of page entries the CPU must track, yielding several advantages:

  • Reduced TLB Cache Misses: The processor can retain a larger working set of memory mappings within its high-speed cache.
  • Higher Compression/Decompression Speeds: Real-world performance gains typically range between 5% and 15%, depending on the dictionary size, algorithm, and hardware configuration.
  • Lower CPU Overhead: Fewer cycles are wasted managing page tables, maximizing core efficiency for actual compression tasks.

Requirements for Enabling Large Pages

Because Large Pages must be locked into physical RAM and cannot be paged to the system swap file, Windows restricts this capability by default. To use Large Pages with 7-Zip, you must meet the following criteria:

  1. 64-bit Windows and 7-Zip: Large Pages are primarily effective on x64 architectures due to continuous address space requirements.
  2. Administrative Privileges: The feature requires the "Lock pages in memory" user right assignment in Windows.
  3. Continuous Physical Memory: Large pages require unfragmented blocks of physical RAM; the feature operates most reliably shortly after system startup.

How to Enable Large Pages for 7-Zip

To configure Windows so 7-Zip can allocate Large Pages, follow these steps:

  1. Press Win + R, type secpol.msc, and press Enter to open the Local Security Policy console (available on Windows Pro, Enterprise, and Education editions).
  2. Navigate to Security Settings > Local Policies > User Rights Assignment.
  3. In the right pane, locate and double-click Lock pages in memory.
  4. Click Add User or Group, enter your Windows username, and click OK.
  5. Click Apply and restart your computer to apply the security policy changes.

Once configured, run 7-Zip File Manager or execute 7-Zip tasks. 7-Zip automatically attempts to allocate Large Pages when initialized with administrative privileges or when launched under an account granted the memory locking policy. You can verify the performance difference directly within the application by running the built-in benchmark located under Tools > Benchmark.