|
liblzma (XZ Utils) 5.8.5
|
Hardware information. More...
Functions | |
| uint64_t | lzma_physmem (void) lzma_nothrow |
| Get the total amount of physical memory (RAM) in bytes. | |
| uint32_t | lzma_cputhreads (void) lzma_nothrow |
| Get the number of processor cores or threads. | |
Hardware information.
Since liblzma can consume a lot of system resources, it also provides ways to limit the resource usage. Applications linking against liblzma need to do the actual decisions how much resources to let liblzma to use. To ease making these decisions, liblzma provides functions to find out the relevant capabilities of the underlying hardware.
|
extern |
Get the total amount of physical memory (RAM) in bytes.
This function may be useful when determining a reasonable memory usage limit for decompressing or how much memory it is OK to use for compressing.
Since liblzma 5.8.5: On Linux, if cgroup v2 memory.max is lower than the amount of physical memory, the memory.max value is returned.
|
extern |
Get the number of processor cores or threads.
This function may be useful when determining how many threads to use. If the hardware supports more than one thread per CPU core, the number of hardware threads is returned if that information is available.
Since liblzma 5.8.5: On Linux, if cgroup v2 cpu.max is lower than the available hardware threads, the return value is the number of threads that can be fully utilitized without being throttled or at least 1 (in case cpu.max is less than 100 % of one core).