Showing posts with label SAP Memory Management. Show all posts
Showing posts with label SAP Memory Management. Show all posts

Monitoring Memory Resources Using Transaction ST06

Use

The OS Monitor (the initial screen of transaction ST06 shows the configured swap space). For more detailed information, see Swap Space Requirements.

Procedure

You can display the memory requirements and the swap space by choosing Detail analysis menu on the entry screen of transaction ST06. This displays the requirements and swap space either as a snapshot or from over a period of hours (buttons Memory and Swap).

This graphic is explained in the accompanying text

Leaving content frame

Checking Roll /Paging Area and Ext. Memory with Trans. ST02

Use

On the initial screen of transaction ST02 (Tune Summary) you can see the following overview of the SAP Memory underneath the Buffer overview.

SAP memory

Current use

Max. use

In memory

On disk

[%]

[kB]

[kB]

[kB]

[kB]

Roll area

5,47

448

1.280

8.192

0

Paging area

0,01

16

72

9.600

252.544

Extended Memory

4,03

6.144

22.528

152.576

0

Heap Memory

0

0

0

0

0

This is a snapshot of the current (percentage and absolute values in kilobytes) and the maximum memory usage of the various SAP Memory Types. The table also indicates whether, and to what extent, the requirement is satisfied from the main memory and from the disk.

Procedure

You can determine from the Extended Memory row that the SAP Extended Memory is sufficiently large. The value [Max. use] is, in this example, noticeably smaller than the created memory area [In memory]. If both values are identical, you must increase the extended memory (profile parameter: em/initial_size_MB).

Virtual Address Space of a Work Process

With 32-bit systems, 4 GB of memory can theoretically be addressed; depending on the operating system, there are approximately 2 GB of virtual address space available to a process.

This consists of a text and a data segment, a dynamically extendible heap and a dynamically extendible stack. The heap increases in size from the bottom and the stack increases from the top; this enables the entire virtual address space to be used.

With an SAP work process, there are special areas reserved on the heap. The size of these special areas can be set using a profile parameter. These areas are:


  • Roll area

  • SAP paging area

  • Private memory

The largest reserved area is located between the heap and stack of the SAP extended memory.

This graphic is explained in the accompanying text

Leaving content frame

User Context

Definition

The user context is the data that is specifically assigned to an SAP user.

Use

Whenever an SAP user starts a transaction (an ABAP program), the work process processing the request always requires the user context.

Structure

Each user can open up to six external sessions (System ® Create session).

The user context contains a user-specific area containing user and authorization data, and a session context for each SAP session.

Each external session can administrate from its side several internal sessions (indicated here with IS), that will not be explained in further detail here.

This graphic is explained in the accompanying text

Integration

All user contexts are contained in a common resource (SAP Extended Memory, SAP Roll Area), which enables a fast context change.

Leaving content frame

Functions of the SAP Memory Management System

An application runs in an SAP work process where an ABAP program is normally executed. The process requires memory to do this, which is allocated to the process by the memory management system. The order in which the work process is assigned the memory type depends on the work process type, either dialog or non-dialog (see SAP Memory Types), and the underlying operating system.

This is described in more detail in the documentation on the operating system.

The location of the various memory areas in the virtual address space is explained in Virtual Address Space of a Work Process.

The area of a user context that is directly accessible is now extended as needed, if the user context has expanded. For dialog work processes, the data of the user context, including internal tables is located in this expanded area. You can therefore access all the data in the user context. Only data of the types "extract" and "export to memory" stay in SAP Paging.

The SAP Roll Area is used for the initial memory assigned to a user context, and (if available) for additional memory if the expanded memory is full.

The following diagram displays the memory types that can be assigned to work processes on the SAP and operating system level. Here are the most important system profile parameters that control the availability of the memory types.

This graphic is explained in the accompanying text

Whenever a dialog step is executed, a roll action occurs between the roll buffer in the shared memory and the memory area, which is allocated according to ztta/roll_first in a dialog process. Then the area in the shared memory is accessed that belongs to this user context.

The following graphic displays the roll process performed by the dispatcher.

· Roll-in: cross-user data is rolled in from the common resource in the work process (and is processed there).

· Roll-out: User-specific data is rolled out from the work process in the common resource (after the dialog step has ended).

The common resource stands for the different SAP memory types.

This graphic is explained in the accompanying text

Leaving content frame

Monitoring the Memory Management System

Use

You should monitor the SAP system during operation to check that Memory Management has the necessary resources, and that frequent paging at operating system level does not slow down the system or cause any bottlenecks.

Flow

The following tools are suitable for monitoring:

· Tune Summary (transaction st02): The current status and the memory resource usage for a specific SAP application server are displayed here. The procedure is described in Checking Roll /Paging Area and Extended Memory using Transaction ST02.

· Transaction st06 for monitoring the available swap space in the host system. See also Monitoring Memory Resources Using Transaction st06.

· CCMS Alert Monitor (transaction rz20): For more information, see the Tutorial in the CCMS Documentation.

· Overview of Users (transaction sm04): Use transaction sm04 or choose Tools ®Administration ® Monitor ® System monitoring ® User overview, and then choose Goto ® Memory to display the amount and type of memory reserved by the user contexts of all users for a specific SAP application server. See Displaying and Administrating User Modes.

· Overview of Work Processes (transaction sm50): Select the Detail button to display the memory resources that have been reserved for a certain work process. See Displaying and Controlling Work Processes.

By monitoring work processes in the SAP system (transaction sm50) or from outside the system (dpmon program at operating system level), you can determine the status of the work processes in relation to the PRIV mode. If work processes are often switched to the PRIV mode, you must increase the extended memory and/or adjust the limit for the extended memory (see Functions of the SAP Memory Management System). In this case, you must consult with SAP.

· You can evaluate this information for all the work processes by using transaction sm66.

· You can determine the Swap Space Requirements at SAP and operating system level.

Many monitoring tools are operating-system dependent. The procedures for monitoring systems on various platforms are described .


Leaving content frame

Allocating Memory for User Contexts (UNIX)

Use

The memory management system assigns memory to user contexts from the following areas: roll area, SAP extended memory, and heap memory.

The order of assignment from these memory areas arranges itself according to whether the user context runs in an SAP dialog work process or in another SAP work process. This enables the SAP system to optimally use the characteristics of the individual memory types.

When allocating memory, the following characteristics for individual memory types become noticeable.

Memory type

Characteristics

SAP Roll Area

Sequential memory allocation to several work processes using a relatively slow copying process

SAP Extended Memory

Sequential memory allocation to several work processes using a fast allocation process Uses swap space

Private memory

Allocation to a local work process, as required for the running user context in the process Uses swap space

Flow

The flow depends on whether it is a dialog work process or not. Unlike other work process types, dialog work processes require frequent context changes. Private memory that is linked to a work process is only assigned if there are no other options.

Allocating Memory for Dialog Work Processes

The following graphic shows how the memory management system assigns memory to a dialog work process with different memory types. Normally, dialog work processes process requests from dialog users of the SAP system.

This graphic is explained in the accompanying text

  1. For technical reasons, the roll area provides the first 100 to 250 KB (depending on the operating system) for the user context. Additional memory for this initial assignment sets itself according to the system profile parameter
  2. ztta/roll_first. If, for example, ztta/roll_first is set to 1000000(1 MB), approximately 1.2 MB roll area is provided. If ztta/roll_first is set to 1, only the technically necessary amount is allocated to roll memory.)
  3. If the memory from the roll area is not sufficient for the user context, more memory is provided from the SAP Extended Memory. Extended memory is available for the user context until one of the following conditions is satisfied:
    • The work process has reached the limit of the SAP Extended Memory for work processes. This limit is set in the system profile parameter
    • ztta/roll_extension.
    • The SAP Extended Memory is used up. The size of the extended memory pool is set in the system profile parameter
    • em/initial_size_MB.
  1. If this memory is also insufficient for the user context, more memory is provided from the roll area until this area is completely used up, or until the limit set in
  2. ztta/roll_area is reached. The roll memory now available sets itself according to the difference between the 2 parameter values ztta/roll_area (total memory in the roll area) and ztta/roll_first (size of assigned roll memory in step 1).
  3. If the user context still requires additional memory, it is assigned heap memory (
  4. Private Memory). Heap memory is available until one of the following situations occurs:
    • SAP restrictions: Either the limit of the heap memory for dialog work processes is reached (defined in the system profile parameter
    • abap/heap_area_dia), or the entire heap memory of all work processes for an SAP application server reaches its limits (defined in parameter abap/heap_area_total).
    • Operating system limits for allocating memory
    • The swap space in the host system is used up or the upper limit of the operating system address space (as determined by the 32-bit architecture) is reached. Try to avoid these situations at all times. To avoid this situation, you must set parameter
    • abap/heap_area_total correctly.

Allocating Memory for Other Work Processes

The following graphic shows how the memory management system assigns memory to non-dialog work process (background, update, lock and spool work processes) with different memory types.

This graphic is explained in the accompanying text

  1. The memory is taken from the roll area until the area is used up. The maximum size of the roll area is set in the system profile parameter
  2. ztta/roll_area.
  3. If the roll area is full, heap memory is allocated to the work process. Heap memory is available until one of the following situations occurs:
    • SAP restrictions: Either the limit of the heap memory for non-dialog work processes is reached (defined in the system profile parameter
    • abap/heap_area_nondia), or the entire heap memory of all work processes for an SAP application server reaches its limits (defined in parameter abap/heap_area_total).
    • Operating system limits for allocating memory
    • The swap space in the host system is used up. This situation should never occur (see
    • Swap Space Requirements).
  1. If no more private heap memory can be allocated, a non-dialog work process can use the SAP extended memory.

Leaving content frame

ztta/roll_first: Initial Allocation Size from the Roll Area

Use

This parameter determines the amount of roll memory in bytes that is allocated to a dialog work process, before SAP Extended Memory is allocated.

The graphic below shows the parameter’s relationship to the entire roll area (parameter ztta/roll_area).

This graphic is explained in the accompanying text


Activities

The default value is platform-specific and is determined dynamically. The default value is specified in transaction RZ11. This value should not normally be changed.

On 64 bit platforms, where there is sufficient extended memory, the default value of this parameter is 1, the work process therefore is allocated extended memory straight away.

SAP Roll Area

Definition

The roll area is a memory area with a set (configurable) size that belongs to a work process. It is located in the heap of the virtual address space of the work process.

Use

When the context of a work process changes, the data is copied from the roll area to a common resource called the roll file. To prevent repeated copying, another roll buffer is located in between that is part of the shared memory.

Structure

The roll area consists of 2 segments. The first segment, which can be set with the parameter ztta/roll_first, is assigned to the work process first as memory. If this is used up, the work process has more memory assigned to it. The amount of memory is determined by the difference between the parameters ztta/roll_area and ztta/roll_first.

For more detailed information, please see the platform-specific section under Implementation.

Integration

For technical reasons, the roll area is always the first memory that receives a work process. Only afterwards can extended memory be requested.