0% found this document useful (0 votes)
13 views32 pages

ABAP Memory Management

The document provides an overview of SAP NetWeaver ABAP Memory Management, detailing memory classes, analysis tools, and configuration issues before and after SAP Kernel 7.4x. It highlights key changes in memory management, including the removal of roll memory and the integration of the table buffer into extended memory, which affects available memory for user contexts. Additionally, it discusses common errors related to memory configuration and monitoring tools for managing memory consumption.

Uploaded by

James Jung
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views32 pages

ABAP Memory Management

The document provides an overview of SAP NetWeaver ABAP Memory Management, detailing memory classes, analysis tools, and configuration issues before and after SAP Kernel 7.4x. It highlights key changes in memory management, including the removal of roll memory and the integration of the table buffer into extended memory, which affects available memory for user contexts. Additionally, it discusses common errors related to memory configuration and monitoring tools for managing memory consumption.

Uploaded by

James Jung
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 32

SAP NetWeaver ABAP Memory Management

Aug, 2015 Internal

s lide only with an image


Use this title
Agenda

SAP NetWeaver ABAP Memory Management before SAP Kernel 7.4x


• SAP NetWeaver ABAP Memory Classes
• Memory Analysis Tools, Typical Memory Configuration Issues

SAP NetWeaver ABAP Memory Management in SAP Kernel 7.4x


• SAP NetWeaver ABAP Memory Classes in SAP Kernel 7.4x

Main Change of Memory Management between SAP Kernel 7.4x and Before SAP Kernel 7.4x

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 2


SAP Netweaver ABAP Memory Management
Physical and Virtual Memory

Server
Virtual Memory

Physical
Memory
= RAM

Operating System
Swap/ Page File * Unlike physical memory, virtual memory can be allocated by the SAP
system. The operating system determines if the allocated memory area
resides in the physical memory or the in the operating system swap space

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 4


SAP Memory Areas - Overview

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 5


Allocation Sequence of a Work Process (STD)
Roll (1) Roll (3)
ztta/roll_first ztta/roll_area - ztta/ roll_first

Dialog Heap
Work process
Extended Memory
(2) (4)
ztta/roll_extension(_dia) abap/heap_area_dia
em/initial_size_MB abap/heap_area_total

Non-Dialog
Roll Heap Extended Memory
Work process
(1) (2) (3)
ztta/roll_area abap/heap_area_nondia ztta/roll_extension(_nondia)
abap/heap_area_total em/initial_size_MB

default values of 64-bit SAP Kernel (Q1/2007):


ztta/roll_first: 1 abap/heap_area_dia:
2 000 000 000 (1,8 GB)
ztta/roll_area: 6 500 000 (6,5 MB) abap/heap_area_nondia:
ztta/roll_extension: 2 000 000 000 (1,8 GB) abap/heap_area_total:

em/initial_size_MB: 4096 (4 GB)


© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 6
RSMEMORY

SE38 -> RSMEMORY

In report RSMEMORY, you can see: a. the


allocation sequence of memory, which is
identified by memory class (0,1,2…)

b. the quota size of different memory areas

You can change the quota size and apply


them immediately by clicking ‘Copy’ button

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 7


ST02 - Memory Consumption overall – Extended Memory

• In the Setups/Tune Buffers monitor (Transaction ST02), you can monitor the R/3 buffers
and the memory management.
• If there is a 100% current use of Extended Memory. This 100% use would cause additional
work processes to go into PRIV Mode.

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 8


ST02 Mode List – Memory consumption for ALL user contexts

• Call the Setups / Tune Buffers monitor (Transaction ST02), and choose Detail analysis
menu  SAP memory  Mode list.

• There you can see the memory consumption of all user contexts.

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 9


SM04 – Memory

SM04 -> Goto -> Memory

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 10


ST22 ABAP Dumps

Calltransaction ST22 and check recent ABAP dumps, restrict the dumps memory management
relevant. Typical ones are introduced in next slides:

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 11


Errors due to Incorrect Memory Area Configuration

SAPinstance does not start because the operating system cannot provide the requested
memory areas.

 Session terminations: A dialog window appears on the user’s screen with the error message
“roll-out failure”. The session then disappears and the user is logged off.

 ABAP Dumps: Program terminations, you will find the logs for these errors (dumps) in
Transaction ST22.
Program error (endless loop) or used incorrectly – unnecessary amount of memory requested.
SAP profile parameters set incorrectly
Swap space on the operating system is not large enough
Operating system limits are reached - incorrect OS parameters

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 12


Typical ST22 Dumps (1)

 STORAGE_PARAMETERS_WRONG_SET, SYSTEM_ROLL_IN_ERROR,
TSV_TNEW_BLOCKS_NO_ROLL_MEMORY, TSV_TNEW_PAGE_ALLOC_FAILED,
TSV_TNEW_NO_ROLL_MEMORY.

The memory for the user context is used up.

• PXA_NO_SHARED_MEMORY.

The allocated areas in the shared memory (EM and PXA) violate the OS
specific restrictions.

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 13


Typical ST22 Dumps (2)

• DBIF_RTAB_NO_MEMORY, DBIF_RSQL_NO_MEMORY.

Memory bottleneck during an operation in the database interface.

• SYSTEM_NO_MORE_PAGING
TSV_TNEW_PAGE_ALLOC_FAILED.

SAP paging memory is used up.

• SYSTEM_NO_ROLL.

If ztta/max_memreq_MB is set too low.

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 14


Problems with work processes in PRIV Mode

 Why do work processes enter PRIV Mode?

When a dialog process is forced to allocate SAP Heap memory it automatically enters PRIV
Mode, i.e. no other user can access this work process.

 How to distinguish if this is a problem or not:

Normal PRIV Mode situation – user is running a big report and EM for this particular user is
exhausted.

Check ST02 EM to verify that all of EM isn’t exhausted. Check individual consumption of EM
with SM04 or SM50 > Detailed Analysis of work process

Many processes in PRIV Mode – all EM for that instance is exhausted.

Check if some processes are consuming all of EM e.g. Batch jobs. Check current
configuration for EM as it may not be sufficient.

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 15


Problem with Program Buffer (1)

• High number of swaps in the program buffer should be avoided


• Check transaction ST02 for a snapshot analysis for current swaps

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 16


Problem with Program Buffer (2)

From ST02 check the following:

• Daily program buffer swaps should be <= 10000

• Program buffer hitration ≥95%

From ST03 check the following:

• Average Load + Gen Time <50ms

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 17


SAP NetWeaver ABAP Memory Management in SAP Kernel
7.4x
Memory Classes in NetWeaver ABAP

SAP Roll Memory (until NW 7.3x, note 2085980)


• session’s initial memory request
SAP Extended Memory (shared)
• Largest part of a Dialog-user context
• Additional memory for Non-Dialog work processes
Heap Memory (Process Local Memory, private)
• Used by default from Non-Dialog work processes
• Additional memory for dialog work process
• Cannot be accessed from other work process
(PRIV- Mode)

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 19


More Memory Areas

SAP Buffers (shared)


• SAP-internal memory areas to buffer frequently used data
• e.g. ABAP programs( Program eXecution Area, PXA)
• Table content (table buffer), …
SAP PROC Memory (Since NW 7.4x)
• Possibility to relate and limit work
process-internal Heap usage
• Not a new memory Class for users
• Further information can be found in SAP note 2019744

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 20


Allocation Sequence of Work Process

Dialog Extended Memory Heap


Work (1) (2)
process
ztta/roll_extension(_dia) abap/heap_area_dia
em/initial_size_MB abap/heap_area_total

Non-Dialog Heap Extended Memory


Work (1) (2)
process
abap/heap_area_nondia ztta/roll_extension(_nondia)
abap/heap_area_total em/initial_size_MB

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 21


Selected Memory Parameters in NetWeaver AS ABAP

SAP Extended Memory (shared) Heap Memory (private)


• em/initial_size_MB (MB) • abap/heap_area_total (Byte)
maximum amount of Extended memory for all maximum amount of Heap in an instance
users in an instance • abap/heap_area_dia (Byte)
• ztta/roll_extension (Byte) maximum amount of Heap in a single dialog-work
maximum amount of Extended Memory per process
user • abap/heap_area_nondia (Byte) maximum amount
of Heap in a single non-dialog-work process
• em/global_area_MB (MB)
Area for user-and work process-independent
Extended Memory
• abap/shared_objects_size_MB (MB)
Area where ABAP shared objects are stored
rdisp/tbi_buffer_area_MB (MB) SAP Note 941735
new table buffer (since NW 7.4x)
(see SAP Note 2103827)

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 22


Main Difference of Memory Management In
SAP Kernel 7.4x
Main Change for Memory Management in SAP Kernel 7.4x

Roll Memory
• With SAP NetWeaver release 7.4x, the former roll memory has been removed.
Everything, which was previously allocated in roll memory, is allocated in EM now. For
more details refer to SAP Note 2085980.

Extended Memory
• In SAP NetWeaver releases before 7.4x, the table buffer was not part of the EG
(Extended Global Memory) and was not consuming EM.
• For SAP NetWeaver release 7.4x, the new DB table buffer is located in EG now.
Because the EG is part of EM, it means that user contexts have less space in EM. This
could also cause that application server run out of EM more easily, especially if the table
buffer is big and the EM is not so big.

This leads to that the useable space for user contexts is less than in previous releases
without configuration changes

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 24


Main Change for Memory Management since SAP Kernel 7.4x

Before SAP Kernel 7.4x SAP Kernel 7.4x

em/global_area_MB
em/
global_area_MB
Allocation from
EG former roll memory EG
abap/
abap/
shared_objects_size_
shared_objects_size_
MB
MB
Table Buffer
em/initial_size_MB
EM
EM

Allocation from
former roll memory

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 25


User Contexts in Extended Memory

User contexts in EM = em/initial_size_MB – EG

Before 7.4x the EG was


em/ EG = em/global_area_MB + abap/shared_objects_size_MB
global_area_MB
EG i.e. the usable memory for user contexts is
abap/ em/initial_size_MB–
shared_objects_size
_MB
(em/global_area_MB+abap/shared_objects_size_MB)

em/initial_size_MB

EM

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 26


User Contexts in Extended Memoy

User contexts in EM = em/initial_size_MB – EG SAP Kernel 7.4x


With 7.4x, EG is
EG = em/global_area_MB + abap/shared_objects_size_MB +
rsdb/tbi_buffer_area_MB em/global_area_MB
(i.e. it’s using the old table buffer parameters). Allocation from former roll
memory EG
Then the available memory for users contexts is abap/
em/initial_size_MB – (em/global_area_MB + shared_objects_size_MB
abap/shared_objects_size_MB + table buffer)
Table Buffer
em/initial_size_MB

EM

Allocation from
former roll memory

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 27


System Configuration for Extended Memory
Extended Memory

ST02-> Extended
memory

Extended Global Memory

SE38->RSMEMORY
->EG Overview

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 28


System Configuration for Extended Memory

Table Buffer

ST02-> Table Buffer

RSMEMORY-> EG consumer

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 29


System Configuration for Extended Memory

Table Buffer Configuration:

rsdb/tbi_buffer_area_MB:
rsdb/tbi_buffer_area_MB defines the size of the table buffer in Megabytes.
It replaces the profile parameters rtbb/buffer_length and zcsa/table_buffer_area.
If rsdb/tbi_buffer_area_MB is not set explicitely, but rtbb/buffer_length and zsca/table_buffer_area are
set, for backwards compatibility, the size of the table buffer is automatically calculated by the following
rule:
Size of table buffer in Bytes = ( rtbb/buffer_length * 1024 + zsca/table_buffer_area ) * 1.1
and as of kernel version 7.4x, the default values of rtbb/buffer_length with zero administration memory
management is:
rtbb/buffer_length = (zcsa/table_buffer_area) * 0.1 / 1024
so in this example
rsdb/tbi_buffer_area_MB = (1.21 * zsca/table_buffer_area) / 1024 /1024
For more details of the parametrization of the table buffer please refer to SAP Note 1864189.

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 30


System Configuration for Extended Memory

Scenario:
Increase table buffer by setting zcsa/table_buffer_area = 3221225472 (3G) (the parameter is
changing from 2GB to 3GB), what’s the changed size for table buffer and extended memory?
According to the table buffer calculation as rsdb/tbi_buffer_area_MB is not set explicitely , table
buffer will increase 1024 MB *1.21 = 1239 GB
Table Buffer increase:

Higher Extended Memory Consumption:

© 2015 SAP SE or an SAP affiliate company. All rights reserved. Customer 31


Thank you

© 2015 SAP SE or an SAP affiliate company. All rights reserved.

You might also like