MENU

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Hana Physical Memory



Physical memory is the basis for all memory discussions. On most SAP HANA hosts, it ranges from 256 gigabytes to 2 terabytes. The following ways ,we can determine the amount of physical memory:

You can use the M_HOST_RESOURCE_UTILIZATION , view to explore the amount of Physical Memory as follows:

Available Physical Memory:

select round((USED_PHYSICAL_MEMORY + FREE_PHYSICAL_MEMORY) /1024/1024/1024, 2) as "Physical Memory GB" from PUBLIC.M_HOST_RESOURCE_UTILIZATION;

Linux command:

cat /proc/meminfo | grep MemTotal

Free Physical Memory:

select round(FREE_PHYSICAL_MEMORY/1024/1024/1024, 2) as "Free Physical GB" from PUBLIC.M_HOST_RESOURCE_UTILIZATION;

Linux command:

awk 'BEGIN {sum = 0};
/^(MemFree|Buffers|Cached):/ {sum = sum + $2}; END {print sum}' /proc/meminfo

SAP HANA Allocated Memory:

The SAP HANA database (across its different processes) reserves a pool of memory before actual use.

This pool of allocated memory is pre-allocated from the operating system over time, up to a predefined global allocation limit, and is then efficiently used as needed by the SAP HANA database code. More memory is allocated to the pool as used memory grows. If used memory nears the global allocation limit, the SAP HANA database may run out of memory if it cannot free memory. The default allocation limit is 90% of available physical memory, but this value is configurable.

To find the global allocation limit of the database, run below SQL query:

select HOST, round(ALLOCATION_LIMIT/1024/1024/1024, 2) as "Allocation Limit GB" from PUBLIC.M_HOST_RESOURCE_UTILIZATION

Effective Allocation Limit:

In addition to the global allocation limit, each process running on the host has an allocation limit, the process allocation limit. Given that all processes cannot collectively consume more memory than the global allocation limit, each process also has what is called an effective allocation limit. The effective allocation limit of a process specifies how much physical memory a process can in reality consume given the current memory consumption of other processes.

Example:

A single-host system has 100 GB physical memory. Both the global allocation limit and the individual process allocation limits are 90% (default values). This means the following:

        Collectively, all processes of the HANA database can use a maximum of 90 GB.
        Individually, each process can use a maximum of 90 GB.

If 2 processes are running and the current memory pool of process 1 is 50 GB, then the effective allocation limit of process 2 is 40 GB. This is because process 1 is already using 50 GB and together they cannot exceed the global allocation limit of 90 GB

No comments: