Powered By

Free XML Skins for Blogger

Powered by Blogger

Friday, January 9, 2009

R/3 Extended Memory

Definition

SAP R/3 Extended Memory is the core of the R/3 memory management system. Each R/3 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 using the profile parameter em/initial_size_MB. Under Windows NT, further memory is assigned dynamically as needed, and you can also set this amount.

Use

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.

Structure

Depending on the operating system, how you implement the Extended Memory is different.

Windows NT: Implementation with Map/Unmap

Here, a roll-in corresponds to mapping a context in the Extended Memory, and a roll-out corresponds to unmapping.

The following graphic displays 2 work processes that are accessing a common resource.

The common resource (memory mapped file) contains all the user contexts. The Extended Memory of a work process contains an area reserved for mapping the current user context.

The graphic displays a context change or transfer: First, the context for user X, mode Y is mapped in the Extended Memory of work process 1. The work process processes an inquiry of this context. Analogous to this, the context from user N, mode M is mapped in the reserved area of work process 2 (marked with a 1). After processing, both work processes "put" the (changed) context back in the common resource by making the context visible again.

Then work process 1 can process the context for user N, mode M and work process 2 can process the context from user X, mode Y (marked with a 2).

The start address for the mapped context is always the same.

UNIX: Implementation with Memory Protection (Protect/Unprotect)

Here, a roll-in corresponds to removing the protection for a context in the Extended Memory, and a roll-out corresponds to protecting a context.

All user contexts are always mapped in the virtual address space for each work process. At the beginning, all the contexts are protected.

The example from above changes to the following:

Work process 1 removes the protection for the context from user X, mode Y. To do this, this context is locked for all other work processes. After processing, the protection is restored. Now, work process 2 can process this context.

Integration

The R/3 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. For more information, refer to the man page "mmap" (UNIX systems), or Create File Mapping and Map View of File for Microsoft Windows NT.

No comments:

Archives