HANA Administration
BASIS / Technicalintermediate

HANA Memory Management and Workload Governance

How SAP HANA allocates and governs memory and CPU resources, and how Basis administrators configure limits to keep multi-tenant and production systems stable under load.

Explanation

SAP HANA is an in-memory database, so memory is the single most consequential resource an administrator manages. Every table, index, and result set that HANA keeps 'hot' consumes RAM, and if memory is exhausted the database can reject new statements or, in severe cases, restart services. Understanding how HANA allocates memory is therefore not optional knowledge for Basis teams supporting production S/4HANA or BW/4HANA systems. HANA memory is organized into a few conceptual pools. The 'global allocation limit' caps the total memory the HANA instance may use, and by default this is calculated from physical RAM, but administrators can and often should set it explicitly, especially in multi-tenant database container (MDC) environments where several tenant databases share one host. Each tenant then has its own allocation limit that must fit inside the overall system limit. Getting these limits wrong is a common cause of contention: if tenants are allowed to over-commit against physical memory, one noisy tenant can starve others. Within a tenant, memory is split between the row store, column store, and various caches (plan cache, result cache) plus temporary work areas used during query execution. Column store tables are compressed in memory, and HANA periodically 'unloads' columns that have not been accessed recently to free space for active data, reloading them on demand. Administrators monitor unload/reload behavior because excessive unloading under memory pressure can cause performance regressions even though the system stays technically available. Workload Management is the mechanism for controlling how concurrent statements compete for CPU and memory. Workload classes let administrators group statements, for example by application or by user, and assign priorities, statement memory limits, and thread limits. This matters in real deployments because a poorly written custom report or an ad hoc BW query can otherwise consume unbounded resources and degrade response times for core dialog transactions. Admission control complements this by rejecting or queuing new statements when the system is under critical memory or CPU pressure, protecting the database from cascading failures rather than letting every request fail simultaneously. On S/4HANA systems, Basis teams also need to be aware of application-driven memory consumers such as ABAP-managed database procedures and calculation views used by CDS-based reporting; these execute inside the HANA engine and their memory footprint is governed by the same limits described above, not by ABAP work process memory parameters. In HANA Cloud and other SAP-managed cloud offerings, some of these controls are abstracted or restricted: capacity is often defined by a service plan, and low-level memory limit configuration may not be exposed to customer administrators in the same way as on-premise HANA. Administrators supporting cloud tenants should verify current capabilities rather than assuming on-premise parameters apply, since capability boundaries evolve and SAP may change what is customer-configurable versus fully managed. Day-to-day administration involves setting reasonable allocation limits during sizing and go-live, then continuously monitoring memory usage trends, tenant-level consumption in MDC landscapes, and workload class effectiveness during peak periods such as month-end closing, using the standard monitoring views and cockpit tools available for the platform in use.

Code example

ABAP Code
-- Inspect current global and tenant memory allocation limits (SQL, run via HANA studio/DBACOCKPIT SQL console)SELECT HOST, PORT, KEY, VALUEFROM M_HOST_RESOURCE_UTILIZATION; -- Check tenant-level allocation limit configuration (on-premise MDC)SELECT DATABASE_NAME, ROUND(TOTAL_MEMORY_USED_SIZE/1024/1024/1024,2) AS USED_GBFROM M_DATABASES; -- Example: set a global allocation limit (in MB) via nameserver.ini configuration change-- Executed through HANA cockpit/hdbnsutil or configuration change API, not raw SQL:-- [memorymanager]-- global_allocation_limit = 409600 -- Create a workload class to cap a reporting user group's memory per statementCREATE WORKLOAD CLASS "WC_BW_REPORTING"  SET 'PRIORITY' = '3', 'STATEMENT MEMORY LIMIT' = '4' , 'STATEMENT THREAD LIMIT' = '10'; CREATE WORKLOAD MAPPING "WM_BW_USERS"  WORKLOAD CLASS "WC_BW_REPORTING"  SET 'USER NAME' = 'BW_REPORT_USER';

Real project scenario

During a month-end close on an S/4HANA production system, dialog users reported slow transaction response while a scheduled BW extraction job ran heavy aggregation queries against the same HANA instance. Basis analysis showed the extraction queries were consuming a disproportionate share of statement memory and threads, pushing the system close to its admission control threshold. The team created a dedicated workload class with a statement memory limit and thread cap for the extraction technical user, and rescheduled the job outside the closing window as a longer-term fix. After the change, dialog response times during subsequent closes remained stable even when the extraction ran concurrently.

Common mistakes

โ€ข Leaving the global allocation limit at its automatically calculated default in a multi-tenant host without validating it against actual tenant sizing needs โ€ข Assuming ABAP work process memory parameters control HANA-side calculation view or AMDP memory consumption โ€ข Not creating workload classes for known heavy batch or reporting users, allowing them to compete unrestricted with OLTP traffic โ€ข Reacting to out-of-memory events only after they occur instead of monitoring memory trend data proactively โ€ข Applying on-premise parameter guidance directly to HANA Cloud without checking which settings are actually customer-configurable

Best practices

โ€ข Set explicit tenant allocation limits in MDC landscapes rather than relying purely on defaults โ€ข Use workload classes to isolate known heavy consumers such as batch, BW extraction, or ad hoc reporting users โ€ข Monitor memory and thread utilization trends regularly, not just during incidents โ€ข Coordinate memory limit changes with the SAP Basis and database teams before major batch or close cycles โ€ข Validate cloud service capability boundaries before assuming on-premise configuration options are available

Interview angle

Interviewers assess whether a candidate understands HANA memory as a governed, shared resource rather than an unlimited cache, and whether they can explain workload classes and admission control as production stability tools rather than academic features. Strong answers describe a real incident where resource contention was diagnosed and resolved with workload governance rather than simply adding hardware.