SAP HANA memory consumption and license

时间:2022-09-10 19:21:17

Hello Everyone,

 

here's a brief explanation on memory consumption and associated licensing for SAP HANA (Thanks to SAP Development Support):

 

The SAP HANA studio's overview tab shows the actual memory consumption from the operating system's perspective. You can see here how much data is resident in physical memory ("Physical Memory" box) and resident in physical memory + swap ("Virtual Memory" box).

 

In the "Licensing" screen, you can see the amount of memory allocated by SAP HANA databases, which includes pre-allocated working memory that might not yet be resident in physical memory or swap. This amount is used for licensing.

 

Customers should only take the Licensing screen into account to check if the installation fits into the licensing. The Overview tab can be used to monitor the machine where HANA databases is running on.

 

Memory allocation in HANA Database implements a pool concept. That is, memory is pre-allocated (reserved) from the operating system for performance reasons. By default, the HANA database will allocate up to approximately 90% of the available physical memory
(see  global.ini -> memorymanager configuration for changing the defaults). Please not that this does not imply the given amount of physical memory is pre-allocated in a specific point of time, it is just the upper limit.

 

Terms:

  • Physical Memory: The amount of memory available on the machine
  • Allocation Limit: Amount of memory that can be allocated (reserved) from the operating system (maximum pool size). We suggest to set the allocation limit to the licensed amount of memory.
  • Allocated Memory: Amount of memory currently allocated from the operating system (current pool size). This is the memory available to HANA database.
  • Used Memory: Amount of memory that is actually used by HANA Database (share from the pool that is in use, this includes memory used for the program code, the tables, and for temporary computations)

 

The size of Allocated Memory size will grow when Used Memory approaches Allocated Memory. If Used Memory is near the Allocation Limit, HANA database may run out of memory if it can't free resources.

 

1. What happens if allocated memory (memory available to HANA database) reaches the licensed limit?

 

Technically, nothing. However, you would need to upgrade your license to fullfill the contract. We suggest to set the allocation limit (global.ini -> memorymanager -> global_allocation_limit) to the amount of memory you have licensed. Please note that the limit applies to each node in a distributed system individually, so if you have a multi-node system, set the limit to <memory licensed>/<num_nodes>.

 

2. Memory consumption is growing although no data is uploaded

 

The SAP HANA database uses main memory not only for storing data, but also for doing its computations. This means if you run queries, the Used Memory will and Allocated Memory may increase.

 

Regards,
Marc
SAP Customer Solution Adoption (CSA)