SAP Hana - Resident Memory

> Database > SAP HANA Database (hdb) > SAP Hana - Memory

1 - About

Resident memory in Hana.

See also: SAP Hana - Memory

Once a temporary computation completes or a table is dropped, the freed memory is returned to the memory manager, who recycles it to its pool, usually without informing the OS. Thus, from SAP HANA’s perspective, the amount of Used Memory shrinks, but the process’ virtual and resident sizes are not affected.

3 - Monitoring

3.1 - Hana Studio

3.1.1 - Database Resident

For the SAP Hana process:

SELECT 
   round(SUM(PHYSICAL_MEMORY_SIZE)/1024/1024/1024,2) AS "Database Resident Memory (Gb)" 
FROM 
  M_SERVICE_MEMORY

Example:

1,75
Advertising

3.1.2 - Total Resident (Host Resource Utilization)

SELECT
        T1.HOST
      , ROUND(( T1.USED_PHYSICAL_MEMORY + T2.SHARED_MEMORY_ALLOCATED_SIZE ) / 1024 / 1024 / 1024, 2 ) AS "Host Memory (Gb)"
    FROM
        M_HOST_RESOURCE_UTILIZATION AS T1
    JOIN
        (
            SELECT
                    M_SERVICE_MEMORY.HOST
                  , SUM( M_SERVICE_MEMORY.SHARED_MEMORY_ALLOCATED_SIZE ) AS SHARED_MEMORY_ALLOCATED_SIZE
                FROM
                    SYS.M_SERVICE_MEMORY
                GROUP BY
                    M_SERVICE_MEMORY.HOST
        ) AS T2
    ON
        T2.HOST = T1.HOST;
1,5

3.1.3 - Others

SELECT 
    HOST, 
    round((USED_PHYSICAL_MEMORY + FREE_PHYSICAL_MEMORY)/1024/1024/1024, 2) AS "Physical Memory GB", 
    round(USED_PHYSICAL_MEMORY/1024/1024/1024, 2) AS "Resident GB" 
FROM 
   PUBLIC.M_HOST_RESOURCE_UTILIZATION

4 - Support

4.1 - Comparison Total Resident vs Database Resident Memory

If the difference between 'Total Resident' and 'Database Resident' is below a significant threshold (2GB), there is no indication that processes outside the database contribute significantly to memory consumption.

5 - Documentation / Reference