/home/steven/tmp/wz/xz-utils/xz-utils-4.999.9beta+20100212/src/liblzma/common/hardware_physmem.c File Reference

Get the total amount of physical memory (RAM). More...

#include "common.h"
#include "tuklib_physmem.h"

Functions

uint64_t lzma_physmem (void)
 Get the total amount of physical memory (RAM) in bytes.


Detailed Description

Get the total amount of physical memory (RAM).


Function Documentation

uint64_t lzma_physmem ( void   ) 

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. For example, the default limit used by the xz command line tool is 40 % of RAM.

Returns:
On success, the total amount of physical memory in bytes is returned. If the amount of RAM cannot be determined, zero is returned. This can happen if an error occurs or if there is no code in liblzma to detect the amount of RAM on the specific operating system.

References tuklib_physmem().

Referenced by hardware_memlimit_set_percentage(), and memlimit_set_percentage().


Generated on Wed Feb 17 14:53:45 2010 for XZ Utils by  doxygen 1.5.6