Memory Management
Webinar
Raquel Gómez, SAP
December, 2017
CUSTOMER
Agenda
▪ Memory types
▪ Relevant Parameters
▪ OS specific differences
▪ Memory monitoring
▪ Dumps and troubleshooting
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 2
Memory types
Memory types
➢ physical main memory + OS swap =
virtual memory
➢ virtual memory = shared memory +
local memory (heap)
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 4
Memory types
The different SAP memory types are:
Extended Memory
Local memory (heap memory)
Paging memory
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 5
Relevant Parameters
Relevant parameters
Resources & Quotas
Resource size is defined by:
em/initial_size_MB or EM/TOTAL_SIZE_MB (AIX)
▪ Extended Memory
Each individual WP is able to allocate the quota defined by
ztta/roll_extension_(non)dia
Additional quota for a user context in the Extended Memory is
em/address_space_MB (Windows and Linux_map)
Extended Global (EG) memory is also stored
in the EM pool and its size is defined by
em/global_area_MB and other few areas.
EG
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 7
Relevant parameters
Resources & Quotas
PRIV size is defined by:
abap/heap_area_total
▪ Heap (local) memory
Each individual WP is able to allocate the quota defined by
abap/heap_area_(non)dia
To release memory from OS perspective: abap/heaplimit
#2360519 - abap/heaplimit increased for kernel releases 7.42 and higher
#1571845 - Error: "WP has reached abap/heaplimit" - What does it mean?
PROC size is defined by:
em/proc_max_size_MB
Each individual WP is able to allocate em/proc_max_wpsize_MB
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 8
Relevant parameters
Paging memory
rdisp/PG_SHM
▪ rdisp/PG_SHM: Size of the Paging Buffer
▪ rdisp/PG_MAXFS: Maximum Size of the SAP rdisp/PG_MAXFS
Paging File
#1081722 - SAP Paging in shared memory
ST02:
rdisp/PG_SHM = rdisp/PG_MAXFS
rdisp/PG_MAXFS = 32880
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 9
Relevant parameters
New features
▪ #2085980 - New features in memory management as of Kernel Release 7.40
❖Zero administration memory management
❖Abolition of "classic" ROLL memory
❖Introduction of the new memory class "PROC-Memory“ ("PROCess-Local Memory")
▪ #2148571 - Explanation for higher Extended Memory (EM) and Extended Global Memory (EG) consumption
after upgrade to SAP Kernel 7.4x
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 10
Relevant parameters
Allocation sequence
DIA WP nonDIA WP (not only BTC,
but also UPD, UPD2, SPO)
Relevant parameters on those involved memory types can be found here
It is possible to change memory allocation order and its quotas in RSMEMORY report
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 11
OS specific differences
OS specific differences
OS ES/TABLE es/implementation Parameters
SHM_SEGS EM/TOTAL_SIZE_MB
AIX ES/SHM_SEG_SIZE
ES/SHM_PROC_SEG_COUNT
ES/SHM_MAX_SHARED_SEGS
ES/SHM_MAX_PRIV_SEGS
ES/SHM_USER_COUNT
ES/SHM_SEG_COUNT
UNIX_STD std / map em/initial_size_MB
Linux es/max_seg_size_MB
es/max_segments
- em_adress_space_MB
UNIX_STD std / map em/initial_size_MB
Solaris es/max_seg_size_MB
es/max_segments
- em/address_space_MB
HP-UX UNIX_STD std em/initial_size_MB
es/max_seg_size_MB
es/max_segments
Windows UNIX_STD view / flat em/initial_size_MB
em/max_size_MB
em/address_space_MB
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 13
OS specific differences
AIX
ES/TABLE = SHM_SEGS
#789477 - Large extended memory on AIX (64-bit) as of Kernel 6.20
abap/shared_objects_size_MB < ES/SHM_SEG_SIZE
EM/TOTAL_SIZE_MB rsdb/tbi_buffer_area_MB < ES/SHM_SEG_SIZE
ES/SHM* parameters
#2362949 - AIX: Calculation of ES/SHM_SEG_SIZE
#2224372 – Remove the limit on maximum segment size on AIX
ES/SHM_SEGS_VERSION=3
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 14
OS specific differences
Windows
#88416 - Zero administration memory management for the ABAP server
em/address_space_MB = $(em/initial_size_MB)
em/initial_size_MB = 0.7 * $(PHYS_MEMSIZE)
em/max_size_MB = 1.5 * $(PHYS_MEMSIZE)
PHYS_MEMSIZE
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 15
OS specific differences
Linux
es/implementation = std
#941735 – SAP memory management for 64-bit Linux system => std
#386605 - SAP Memory Management for Linux (32-bit) => map
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 16
Memory monitoring tools
Memory monitoring tools
✓ sappfpar check pf=<path to instance profile>
✓ ST22 dump
✓ SE38 RSMEMORY Allocation sequence & quotas & EG/PROC Overview
✓ ST02 General overview
✓ ST06 OS resources
✓ SM04 snapshot of memory being used but no history
✓ SM50 & SM66 (PRIV)
✓ /SDF/MON
✓ RZ20
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 18
Dumps and troubleshooting
Dumps and troubleshooting
MEMORY_NO_MORE_PAGING
The R/3 page buffer is made up of 2 parts:
- the first part always uses shared memory (rdisp/PG_SHM)
- and then uses disk if it needs more (rdisp/PG_MAXFS).
dev_w<nr>:
M <timestamp>
P *** ERROR => <PAGE-FL> get block: no more free blocks [rpag.c 2186]
M ***LOG P0B=> 045000 [rpag.c 785]
#1563748 - MEMORY_NO_MORE_PAGING" dump occurs
#133909 - Maximum value for PG_MAXFS, PG_SHM, ROLL_MAXFS, ROLL_SHM
#2210107 - Default value for parameter rdisp/PG_MAXFS is 250000 8k blocks (2 GB)
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 20
Dumps and troubleshooting
TSV_TNEW_BLOCKS_NO_ROLL_MEMORY /
TSV_TNEW_PAGE_ALLOC_FAILED
#scenario 1 ztta/roll_extension_(non)dia
Extended memory (EM)........... “ EM quota”
Assigned memory (HEAP)......... “HM quota” abap/heap_area_(non)dia
dev_w<nr>:
M <timestamp>
A SelMemClass: heap quota (DIA) exceeded 2000000000 2002751168
or
A SelMemClass: heap quota (NONDIA) exceeded 2000000000 2002751168
#2180736 - TSV_TNEW_PAGE_ALLOC_FAILED
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 21
Dumps and troubleshooting
TSV_TNEW_BLOCKS_NO_ROLL_MEMORY /
TSV_TNEW_PAGE_ALLOC_FAILED
#scenario 2 EM exhausted?
Extended memory (EM)........... “less than EM quota”
Heap area exhausted?
Assigned memory (HEAP)......... “less than HM quota”
dev_w<nr>:
M <timestamp>
A Wed Aug 02 13:10:00 2017
A *** ERROR => User <USERNAME> reached avail. heapsize = 2000 MB: see ST22 [abstor.c 1904]
A *** ERROR => Increase abap/heap_area_total [abstor.c 1905]
A *** ERROR => heap memory WP0: 453 MB [abstor.c 1909]
A *** ERROR => heap memory WP8: 31 MB [abstor.c 1909]
…..
A *** ERROR => heap memory WP37: 945 MB [abstor.c 1909]
A *** ERROR => heap memory WP45: 24 MB [abstor.c 1909]
#2180736 - TSV_TNEW_PAGE_ALLOC_FAILED
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 22
Dumps and troubleshooting
LOAD_NO_ROLL
Points to EM shortage (EM Exhausted):
Component............ EM
Location.......... SAP-Server <hostname_SID_nr> on host <hostname> (wp <nr>)
Version.............. 37
Error code............ 7
Error text............ Warning: EM-Memory exhausted: Workprocess gets PRIV
#2417223 - LOAD_NO_ROLL dump and Extended Memory exhausted as of Kernel 74x
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 23
Dumps and troubleshooting
RESIZE_EM_ALLOC_ERROR/
shortage on EG
em/global_area_MB: Size of the Extended Global Memory
dev_w<nr>:
*** ERROR => EgAlloc: MmxMalloc failed (9).
see also file 'eg_oom_mm.dump' [egxx.c 605]
*** ERROR => EmIAllocMmResourceEg: EgAlloc(165440) failed 5[emxx.c 3641]
#2152126 - RESIZE_EM_ALLOC_ERROR short dump
#1514752 - Extended Global Memory configuration
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 24
Dumps and troubleshooting
SYSTEM_NO_ROLL
ztta/max_memreq_MB: maximum size of an individual memory request
dev_w<nr>:
A *** ERROR => max. memrequest size exceeded 469185630 268435455 [abstor.c 693]
#353579 - SYSTEM_NO_ROLL
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 25
Dumps and troubleshooting
Memory leaks what to do?
1. Check involved regression Note for system PL:
“Known regressions in kernel 7.xx patch level xx”
#1802333 - Finding information about regressions in the SAP kernel
2. Check from OS perspective which process is allocating the memory, to identify where does the
problem comes from.
Client-Server Technology wiki
Memory Management online documentation
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 26
IMPORTANT STEPS TO REMEMBER
➢ Check which is OS platform
➢ RSMEMORY: Memory allocation order, defined quotas
➢ ST02: Overview of memory resources on the server (since last restart)
➢ Any specific OS-dependant parameter?
➢ Always go to involved Application server and work process trace (dev_w<nr>) to get more
information
➢ Not only increasing memory resources; but also check from application perspective if the
selection criteria can be reduced to reduce the amount of memory being consumed.
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ CUSTOMER 27
Thank you.
Contact information:
Raquel Gómez
SAP Product Support – NW Core
r.gomez@sap.com