Alapadatok

Év, oldalszám:2010, 8 oldal

Nyelv:angol

Letöltések száma:12

Feltöltve:2012. november 28.

Méret:82 KB

Intézmény:
-

Megjegyzés:

Csatolmány:-

Letöltés PDF-ben:Kérlek jelentkezz be!



Értékelések

Nincs még értékelés. Legyél Te az első!


Tartalmi kivonat

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. 1 SAP Roll Area 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. 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 profile parameter 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 extended memory 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 2 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, 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.sapcom 3 B.3 Memory Management Memory management determines for a particular system activity when, and what type and size of memory is allocated. Figure B4 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 process checks 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. 4 2. If Roll Area 1 is insufficient, more memory is allocated from the Extended 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 Private Memory. 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.31 SAP Buffer The SAP Buffer stores frequently used business objects and data. With the SAP Buffer, work processes dont 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 • 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 Administrators 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 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. 7 Integration The graphic below shows the relationship with the parameters abap/heap area dia, abap/heap area nondia, and ztta/roll extension. 8