Three SAP HANA puzzles look contradictory at first:
- HANA used memory falls, but Linux memory stays high.
- Data is deleted, but the data volume file doesn’t shrink.
- Slow storage hurts an in-memory database.
The explanation isn’t one hidden number or one faulty layer. Memory, persistence and backup storage work together but stay distinct, and each puzzle is solved by identifying which layer an observation belongs to.
The layers
- Memory: where HANA does its working activity.
- Data volume: persistent images of the column and row stores.
- Redo log volume: records of committed changes.
- Backups: a separate concern altogether.
Four memory measurements
A teaching example (not a sizing recommendation): a host with 512 GB of RAM, a HANA allocation limit of 450 GB, 360 GB allocated and 300 GB used.
| Measurement | Meaning |
|---|---|
| Allocation limit | The ceiling HANA may use. |
| Allocated memory | What HANA has claimed from the operating system. |
| Used memory | What is actively occupied inside that allocation. |
| Resident memory | An operating-system measurement, a separate perspective. |
The unused part of the allocated pool can be reused, so it isn’t automatically waste or proof of a leak. When temporary work finishes, used memory can fall without an equal, immediate drop in resident memory. That’s puzzle one: comparing one dashboard number against another can create a false diagnosis.
Table data is only part of the picture. Column store main and delta structures, row store data, code, system structures, result caches and working memory all count, and a large query may need significant working memory beyond its input tables.
Main store, delta store and delta merge
The column store has a main store optimized for reads and a delta store optimized for writes. A delta merge combines them into a new, larger main store; meanwhile a new delta store receives incoming changes, so writes aren’t blocked. The merge has a temporary cost in memory, CPU and I/O, so a manual merge isn’t a universal fix for low memory: without understanding the workload, it can increase pressure.
Savepoints and redo logs
A savepoint periodically writes a consistent image of in-memory data to the data volume. Between savepoints, committed changes are protected by redo logging. On restart, HANA reads the last savepoint and replays redo log entries for changes made after it (a simplified model).
Delta storage isn’t redo logging. A delta merge isn’t a savepoint. A savepoint isn’t a backup.
Persistence and recoverability are different goals: savepoints support the restart image, backups support a separate recovery strategy, and system replication isn’t a complete substitute for backups either.
Why storage speed matters
Redo log writes are synchronous to commit confirmation, so log volume I/O sits directly in the transaction path. That’s puzzle three: slow storage can mean slower transactions even when the working data is in memory. Log backups support recovery and, in normal log mode, allow log segments to be reused when other conditions are met.
Never manually delete active data volume or log segment files. Log area growth can involve backup health, destination availability, segment states and retention dependencies; deleting files can damage recoverability instead of fixing the cause.
Why deleting data doesn’t shrink the file
That’s puzzle two. Logical space, allocated space inside the data volume, and file system space used by the volume files are separate concepts. A delete can free space logically while the freed capacity stays inside the allocated volume for reuse, so an unchanged file isn’t proof the delete failed. Physical shrink and reclaim behavior depend on release and configuration; there’s no universal procedure or safe fixed percentage.
Native Storage Extension
NSE adds a page-loadable tier for column store tables, managed through a buffer cache. Column-loadable structures stay fully in memory; page-loadable ones are loaded into the cache on demand and can be evicted under pressure. NSE may reduce memory needs for suitable data, but it still needs cache memory and storage I/O, and it isn’t Linux swap. Converting a table isn’t right in every case.
Investigating three scenarios
- High OS memory, stable HANA used memory: compare the two perspectives separately and review trends over time; one snapshot is weak evidence of a leak.
- Out-of-memory during a busy batch window: look at overlapping statements, memory growth, delta merge activity and allocation limits before concluding you need more RAM.
- Growing log area: review log backup health, destinations, segment states and retention dependencies, and protect recoverability rather than deleting files.
A repeatable discipline: correlate timestamps, establish scope, compare against a baseline, and validate the suspected cause before changing production. HANA cockpit monitoring, expensive statement evidence, merge history and diagnostic traces can help. Available settings and fields depend on your HANA release and revision.
Recap
- Allocated memory isn’t used memory, and resident memory is another perspective.
- A delta merge isn’t a savepoint, and a savepoint isn’t a backup.
- Database size isn’t one number: logical, allocated and file system space differ.
Understand the layer, compare the right measurements, and investigate before changing production.