-slp (Set Large Pages mode) switch

Sets "Large Pages" mode.

Syntax

-slp[-]
-slp[:ps{N}][:min{N}][:nohuge]
Switch Description
-slp Enables "Large Pages" mode. This is the default option for all commands in Linux.
-slp- Disables "Large Pages" mode. This is the default option for all commands in Windows.
-slp:ps{N} Sets the page size: 2^{N} bytes. {N}=21 is the default value, meaning a page size of 2 MiB.
-slp:min{N} Sets the minimum threshold for allocating large pages: 2^{N} bytes. The default threshold value is half the page size: {N}=20 means the threshold value is 1 MiB.
-slp:nohuge for Linux : it forces the program to use small pages (4 KB) instead of huge pages (2 MB).

"Large Pages" mode can increase the speed of 7z/xz/LZMA/LZMA2/PPMd and some other code by 5%-10%.

If "Large Pages" mode is selected, but 7-Zip cannot use large pages, it will use regular small pages without notifying the user.

7-Zip uses large pages only if the allocated memory block size exceeds the minimum memory allocation threshold. This minimum allocation threshold can be changed using the -slp:min{N} switch.

Windows

To monitor memory usage, you can use the Windows Task Manager or the -bt switch in 7-Zip command line.
Task Manager -bt switch Description
Working set Physical Memory This value doesn't include large pages used by the program.
Commit size Virtual Memory This value includes large pages used by the program.

If 7-Zip uses "Large Pages", the displayed value for "Physical Memory" (Working set) will be less than the value for "Virtual Memory" (Commit size).

In order for 7-zip to be able to use "Large Pages", the "Large Pages" feature must be installed on your system if it isn't already installed by 7-Zip or other software. To install the "Large Pages" feature, you must run 7-Zip File Manager at least once with administrator rights, close 7-Zip, and then reboot your system.

Note: On some older versions of Windows, 7-Zip can only use "Large Pages" when running with administrator rights.

Linux

In the Linux version of 7-Zip, the -slp (Huge Pages) mode is used by default. In this mode, 7-Zip uses "madvise" function to advise the kernel to use "huge pages" for allocated memory. Thus, the system can use huge pages, if the "transparent huge pages" (THP) parameter in system is set to "madvise" or "always".

You can force the program to use small pages instead of "huge pages" using the "-slp:nohuge" switch.

Examples

7z a -slp archive.7z a.iso

compresses a.iso file with "Large Pages" mode.

7z a -slp:ps25:min21 archive.7z a.iso

compresses a.iso file with "Large Pages" (Huge Pages) mode, the page size is 2^25 = 32 MiB, and the minimum allocation threshold is 2^21 = 2 MiB.