sap memory managerment

Upload: zahidhcm7190

Post on 04-Apr-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 Sap Memory Managerment

    1/8

    SAP Memory Management

    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 are allocated to it 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 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.

    SAP Roll AreaThe roll area is a memory area with a set (configurable) size that belongs to a work process. It

    1

  • 7/29/2019 Sap Memory Managerment

    2/8

    is located in the heap of the virtual address space of the work process. 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. 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.

    SAP Extended Memory

    SAP extended memory is the core of the SAP memory management system. Each SAP work

    process has a part reserved in its virtual address space for extended memory (see Virtual

    Address Space in a Work Process). You can set the size of extended memory using the profileparameter em/initial_size_MB: Extended Memory Pool Size. Under Windows NT, further

    memory is assigned dynamically as needed, and you can also set this amount. You can map

    the extended memory from the common resource onto any work process, and after onto

    another process (see graphic) on the same address in the virtual address space. This is

    important if you work with pointers in the ABAP program. Depending on the operating

    system, how you implement the extended memory is different. The SAP system builds a layer

    on to the operating system functions for the page management of this memory. This extendedmemory is implemented as an unnamed mapped file. This means the address space uses the

    paging file or uses the swap space of the operating system as background memory.

    Private Memory

    Other processes cannot use private (heap) memory. After releasing the assigned memory, the

    operating system still considers the (virtual) memory as being occupied by the allocating

    process. These characteristics of heap memory require that:

    1. The work process can be run in PRIV mode (private) when the local memory is

    assigned. This means that the work process is reserved for processing the current user

    context until the context releases the work process again when the request has ended.

    2. The work process, if it has used a lot of private memory, is restarted when the user

    context is terminated and the local memory is returned. The restart makes the local

    memory available again for other processes. A restart occurs if a work process uses

    more local memory than is defined in the parameter abap/heaplimit. The mechanism is

    displayed again there.If a dialog work process has used up the roll area assigned to it and the extended memory,

    2

  • 7/29/2019 Sap Memory Managerment

    3/8

    private memory is assigned to the work process. The work process goes into PRIV mode

    (private). In the parameter settings, ensure that not too many dialog work processes are

    simultaneously in the PRIV mode, since this lowers system performance. The other Work

    Process types (background, update, enqueue and spool work processes) are assigned heap

    memory after the roll area is used up. Allocating Extended Memory is not useful since no

    context change occurs for these processes.

    source: http://help.sap.com

    3

  • 7/29/2019 Sap Memory Managerment

    4/8

    B.3 Memory Management

    Memory management determines for a particular system activity when, and what

    type and size of memory is allocated. Figure B.4 shows the components involved in

    SAP memory management.

    Figure B.4. SAP MEMORY MANAGEMENT

    In the figure, Shared Memory represents memory space accessible by all work

    processes. Roll Buffer memory is used to queue user dialog requests. When the Roll

    Buffer becomes full, user dialog requests are swapped to the Roll File. Extended

    Memory stores user context (i.e., user data), such as the authorization and session

    context for each SAP session. Page Buffer memory holds large lists and long internal

    tables. When the Page Buffer becomes full, data are swapped to the Page File.

    Shared Buffer memory stores business objects and data. A dialog work processchecks the Shared Buffer first for required business objects and data before

    searching the BW database. We will discuss the Shared Buffer later.

    When a dialog work process becomes available to process the first user dialog

    request in Roll Buffer, it allocates memory in the following order:

    1. The user dialog request, including the initial user context, is moved from the

    Roll Buffer into Roll Area 1. There the dialog work process can access the

    required data directly.

    2. If Roll Area 1 is insufficient, more memory is allocated from the Extended

    4

  • 7/29/2019 Sap Memory Managerment

    5/8

    Memory.

    3. If the Extended Memory is also insufficient, more memory is allocated from

    Roll Area 2.

    4. If Roll Area 2 is still insufficient, more memory is allocated from the PrivateMemory. Once this allocation takes place, the current dialog work process will

    no longer be available to process other user dialog requests.

    To make Private Memory available again to process other user dialog

    requests, the operating system must restart the dialog work process.

    5. If the Private Memory is still insufficient, the dialog work process is restarted,

    and the user dialog request is terminated.

    After the user dialog request has been processed, the user context rolls into the

    Extended Memory and is ready for use by the next dialog request. In addition, the

    Roll Area and Private Memory allocated for the current dialog work process are

    released.

    This procedure is repeated for each user dialog request in an SAP transaction. At the

    end of the SAP transaction, the last dialog work process copies the modified user

    dialog request back to the Roll Area, and eventually back to the end user.

    B.3.1 SAP Buffer

    The SAP Buffer stores frequently used business objects and data. With the SAP

    Buffer, work processes don't need to access the database if the buffer already

    contains the required information. This strategy helps to reduce database access, the

    load on the database server, and network traffic, thereby improving overall system

    performance. If the required information is not available in the buffer, it must be

    paged into the buffer before it can be used, resulting in slower performance.

    If the SAP Buffer is too small, it cannot hold all of the required information. This

    shortage of space results in the information being swapped out of the buffers.

    If the SAP Buffer is too large, the native operating system will start paging because

    too much memory is taken away and given to SAP, database, or other applications.

    Ten types of buffers exist:

    The Repository Buffer, also called the nametab (NTAB) buffer, contains the

    table and field definitions

    5

  • 7/29/2019 Sap Memory Managerment

    6/8

    The Program Buffer contains the compiled executable versions of ABAP

    programs

    The CUA Buffer contains the GUI objects, such as menus and push buttons

    The Screen Buffer contains the generated ABAP screens

    The Calendar Buffer contains all defined factory and public holiday calendars

    The Generic Key Table Buffer contains a range of table entries; it can also

    hold all the entries in a table

    The Single Record Table Buffer contains the single table entries.

    The Import/Export Buffers contain data that must be available to several work

    processes.

    The Roll and Paging Buffers were discussed earlier in this section.

    The Cursor Cache contains parsed SQL statements.

    For Further Information

    Book: SAP R/3 Administrator's Handbook, by Jose Antonio Hernandez (ed.). McGraw-Hill

    Professional Publishing, 1999. ISBN: 0071354131.

    Book: SAP R/3 System: A Client/Server Technology, by Rudiger Buck-Emden, Jurgen Galimow,

    SAP AG. Addison-Wesley, 1996. ISBN: 0201403501.

    OSS Note 0039412, " How Many Work Processes to Configure."

    OSS Note 0021636, " RAM Extension: Which Changes to Profile?"

    OSS Note 0016223, " Problems with Roll Memory."

    6

  • 7/29/2019 Sap Memory Managerment

    7/8

    Virtual Address Space of a Work Process

    With 32-bit systems, 4 GB of memory can theoretically be addressed; depending on the operatingsystem, 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 dynamicallyextendible 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 specialareas 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.

    7

    http://help.sap.com/saphelp_nw04/helpdata/en/05/0e41e6ba5911d188b20000e83539c3/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/05/0e41e6ba5911d188b20000e83539c3/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/28/d1d3f6bcb411d188b30000e83539c3/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/da/2e5a7a2df7d211b1d10004ac56b168/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/7a/caa6f3bfdb11d188b30000e83539c3/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/34/d9c8b3c23c11d188b40000e83539c3/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/34/d9c8b3c23c11d188b40000e83539c3/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/7a/caa6f6bfdb11d188b30000e83539c3/frameset.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/28/d1d3f6bcb411d188b30000e83539c3/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/da/2e5a7a2df7d211b1d10004ac56b168/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/7a/caa6f3bfdb11d188b30000e83539c3/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/34/d9c8b3c23c11d188b40000e83539c3/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/05/0e41e6ba5911d188b20000e83539c3/content.htm
  • 7/29/2019 Sap Memory Managerment

    8/8

    Integration

    The graphic below shows the relationship with the parameters abap/heap_area_dia,

    abap/heap_area_nondia, andztta/roll_extension.

    8

    http://help.sap.com/saphelp_nw04/helpdata/en/02/9626c0538111d1891b0000e8322f96/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/02/9626cd538111d1891b0000e8322f96/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/02/9626b3538111d1891b0000e8322f96/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/02/9626b3538111d1891b0000e8322f96/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/02/9626c0538111d1891b0000e8322f96/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/02/9626cd538111d1891b0000e8322f96/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/02/9626b3538111d1891b0000e8322f96/content.htm