Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::MemInfo Class Reference

#include <mem-info.h>

Collaboration diagram for impala::MemInfo:

Static Public Member Functions

static void Init ()
 Initialize MemInfo. More...
 
static int64_t physical_mem ()
 Get total physical memory in bytes (ignores cgroups memory limits). More...
 
static int32_t vm_overcommit ()
 Returns the systems memory overcommit settings, typically the values are 0,1, and 2. More...
 
static int64_t commit_limit ()
 
static std::string DebugString ()
 

Static Private Member Functions

static void ParseOvercommit ()
 

Static Private Attributes

static bool initialized_ = false
 
static int64_t physical_mem_ = -1
 
static int32_t vm_overcommit_ = -1
 Indicating the kernel overcommit settings. More...
 
static int64_t commit_limit_ = -1
 If overcommit is turned off the maximum allocatable memory. More...
 

Detailed Description

Provides the amount of physical memory available. Populated from /proc/meminfo. TODO: Allow retrieving of cgroup memory limits, e.g., by checking /sys/fs/cgroup/memory/groupname/impala/memory.limit_in_bytes TODO: Combine mem-info, cpu-info and disk-info into hardware-info?

Definition at line 30 of file mem-info.h.

Member Function Documentation

static int64_t impala::MemInfo::commit_limit ( )
inlinestatic

Returns the systems memory commit limit. This value is only of importance if the memory overcommit setting is set to 2.

Definition at line 49 of file mem-info.h.

References commit_limit_, and initialized_.

Referenced by impala::ExecEnv::StartServices(), and impala::TEST().

string impala::MemInfo::DebugString ( )
static

Definition at line 96 of file mem-info.cc.

References initialized_, physical_mem_, and impala::PrettyPrinter::Print().

Referenced by impala::Webserver::RootHandler().

void impala::MemInfo::Init ( )
static

Initialize MemInfo.

Definition at line 54 of file mem-info.cc.

References commit_limit_, initialized_, impala::ParseMemString(), ParseOvercommit(), and physical_mem_.

void impala::MemInfo::ParseOvercommit ( )
staticprivate

Definition at line 91 of file mem-info.cc.

References vm_overcommit_.

Referenced by Init().

static int64_t impala::MemInfo::physical_mem ( )
inlinestatic
static int32_t impala::MemInfo::vm_overcommit ( )
inlinestatic

Returns the systems memory overcommit settings, typically the values are 0,1, and 2.

Definition at line 42 of file mem-info.h.

References initialized_, and vm_overcommit_.

Referenced by impala::ExecEnv::StartServices(), and impala::TEST().

Member Data Documentation

int64_t impala::MemInfo::commit_limit_ = -1
staticprivate

If overcommit is turned off the maximum allocatable memory.

Definition at line 73 of file mem-info.h.

Referenced by commit_limit(), and Init().

bool impala::MemInfo::initialized_ = false
staticprivate

Definition at line 60 of file mem-info.h.

Referenced by commit_limit(), DebugString(), Init(), physical_mem(), and vm_overcommit().

int64_t impala::MemInfo::physical_mem_ = -1
staticprivate

Definition at line 61 of file mem-info.h.

Referenced by DebugString(), Init(), and physical_mem().

int32_t impala::MemInfo::vm_overcommit_ = -1
staticprivate

Indicating the kernel overcommit settings.

See https://www.kernel.org/doc/Documentation/filesystems/proc.txt for more details on the specific meaning of the below variables and https://www.kernel.org/doc/Documentation/vm/overcommit-accounting for more details on overcommit accounting.

Definition at line 70 of file mem-info.h.

Referenced by ParseOvercommit(), and vm_overcommit().


The documentation for this class was generated from the following files: