Professional Documents
Culture Documents
SAP Memory Management
SAP Memory Management
PDF download from SAP Help Portal: http://help.sap.com/saphelp_nw73ehp1/helpdata/en/49/32eff3e92e3504e10000000a421937/content.htm Created on February 09, 2014
The documentation may have changed since you downloaded the PDF. You can always find the latest information on SAP Help Portal.
Note This PDF document contains the selected topic and its subtopics (max. 150) in the selected structure. Subtopics from other structures are not included.
2014 SAP AG or an SAP affiliate company. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Please see www.sap.com/corporateen/legal/copyright/index.epx#trademark for additional trademark information and notices.
Page 1 of 10
TABLE OF CONTENT
1 Functions of the SAP Memory Management System 1.1 Memory Management Basic Terminology 1.2 SAP Memory Types 1.2.1 SAP Roll Area 1.2.2 SAP Extended Memory 1.2.3 Private Memory 1.3 User Context 1.4 Work Process 1.5 Virtual Address Space of a Work Process 1.6 Release of SAP Memory for the Operating System
Page 2 of 10
Figure 1:
Whenever a dialog step is executed, a roll actionoccurs between the roll buffer in the shared memory and the memory area, which is allocated according to ztta/roll_firstin 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.
Page 3 of 10
Figure 2:
Using the VM Container If the SAP Virtual Machine Containeris active in your system, Java programs can also be executed. Memory management has been extended for this. For more information, see Memory Management in the VM Container More Information Work Process SAP Memory Types Virtual Address Space of a Work Process User Context
Reservation of a segment in the physical memory. Linking the physical memory segment to the virtual address space of the process, which means reserving a segment of the same size in the virtual address space and mapping the virtual addresses to physical addresses.
Local Process Memory The operating system differentiates between local process memory and shared memory. For local process memory the operating system keeps the two allocation steps transparent. Using an API virtual memory only is requested; the operating system does the other tasks, such as reserving physical memory, loading and unloading virtual memory into and out of the main memory. Shared Memory If several processs are to access the same memory area, the two allocation steps are not transparent. One object is created that represents the physical memory and can be used by various processes. The processes can mapthe object fully or partially into the address space. The way this is done varies from platform to platform. Memory mapped files, unnamed mapped
Page 4 of 10
files, and shared memory are used. For more information see Platform-Specific Description of Memory Management.
Caution
The advantages of the memory management system require increased swap space and main memory. The need for swap space increases because full-sized internal tables and lists are in the address space and take up swap space. The main memory requirements may increase to prevent excessive operating system paging due to the increased swap space requirements. For more information, see Swap Space Requirements
More Information SAP Roll Area SAP Extended Memory Private Memory
Page 5 of 10
the difference between the ztta/roll_areaand ztta/roll_first parameters. For more information, see the platform-specific section under Implementation.
Note
For technical reasons, the roll area is always the first memory to receive a work process. Only afterwards can extended memory be requested.
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. Up to this time point no other user context can be mapped to the work process.
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. The restart occurs if a work process uses more local memory than is defined in the parameter abap/heaplimit. The mechanism is displayed again there.
For more information, see: Virtual Address Space of a Work Process Use If a dialog work process has used up the roll area assigned to it andthe extended memory, private memory is assigned to the work process. The work process goes into PRIV mode. 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 processtypes (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. Integration Automatic Termination of PRIV Mode Processes If too many dialog work processes run in the PRIV mode in an SAP application server, performance problems arise. The normal processing of user inquiries is slowed down by the PRIV mode work processes. The SAP system offers a mechanism that lets you terminate non-active dialog processes in the PRIV mode. This mechanism helps reduce performance problems. The mechanism works as follows: In the PRIV mode, a maximum number ( n) of dialog work processes can run without any time restrictions.
Page 6 of 10
To determine this number n, set the value of the profile parameter rdisp/wppriv_max_no. If a value is not entered, the SAP system determines nusing the following formula: the number ( n) is set to the greater of the 2 following values: Number of dialog work processes minus 5 1 If more than ndialog work processes are active andthe time span set in parameter rdisp/max_priv_time(default 600 seconds) has elapsed, the transaction for that PRIV process, which has spent the longest possible time in PRIV mode, is reset.
Example
You have configured 10 dialog work processes on one SAP instance. The parameters rdisp/wppriv_max_noand rdisp/max_priv_timeare not changed (default settings). Then, the SAP system checks periodically if more than 5 dialog work processes are in PRIV mode after 600 seconds (10 minutes). If this is the case, the transaction is reset that has been in PRIV mode for the longest time. A corresponding dialog box appears to the user. If performance problems arise, you can change these parameters, but do this only after consulting with SAP.
Note
Non-dialog work processes (background, update, etc.) are not contained in this mechanism and are also not considered.
Note
You can configure the maximum number of external sessions with parameter rdisp/max_alt_modes, but we recommend that you do not change the default setting of six sessions. The user context contains a user-specific areacontaining user and authorization data, and a session contextfor each external session (technical term: emode). The following figure shows the structure of a user context.
Page 7 of 10
Each external session can administrate from its side multiple internal sessions (technical term imode). This is not explained in detail in this documentation. Integration All user contexts are contained in a common resource, the SAP Extended Memory, which enables a fast context change.
Several dialog work processes usually run on one application server. There are usually only one or two other types of work process. Structure A work process consists of a screen processor, the ABAP interpreter, the database interface and the task handler that calls these programs. Integration The dispatcheris the central process of the application server. After it has been started, it generates the work process. You can configure the number of different types of work process that run on an application server. More Information Virtual Address Space of a Work Process
Page 8 of 10
Page 9 of 10
This function is available in a kernel patch for SAP kernel 4.6D, 6.20 and 6.40. The profile parameters are normally imported into the system from support packages (transaction RZ11). However, you can still use these parameters, even if you have not installed the relevant support package. The procedure described here does not work, if the ES/TABLE = SHM_SEGSparameter is set. In this case memory is already released for the operating system. Features You can control the amount of memory released for the operating system in relation to how busy the extended memory is, and thereby minimize the problems associated with a fully occupied extended memory. Memory above an adjustable threshold in the extended memory is always released for the operating system. As soon as this threshold is exceeded, memory below this threshold can also be released for the operating system for a specified time period. When EM blocks are released, a definable size of the upper section of the EM block can also be released for the operating system. The default procedure when memory is released is the same as the procedure described earlier, that is, no memory is released for the operating system. The release of memory for the operating system can be activated by the following parameters: es/disclaim_threshold_MB(Default: 0, inactive) specifies the threshold above which memory is released for the operating system) es/disclaim_coasting_time_alloc(Default: 0, inactive) es/disclaim_coasting_time_free(Default: 0, inactive) specifies the coasting time in seconds, how long after the threshold has been exceeded memory below the threshold is also freed up for allocation to or release from the operating system. es/blockdisclaimsize_KB(Default: 0, inactive) This parameter specifies in kilobytes the size of the upper part of an EM block that is also released for the operating system. It combines the benefit of smaller EM blocks (em/blocksize_KB) with regard to the main memory requirement, with the benefit of larger EM blocks with regard to performance. es/freelist_compactor(Default: 1) should not be 0, so that the process described above can be fully effective. Activities Import the required kernel patch. The patch text is 'CST Patch Collection 15 2004'. Set the profile parameters as you require. Example em/blocksize_KB = 4096(4MB, default for 64 bit) es/blockdisclaimsize_KB = 2048(2MB, 1/2 of em/blocksize_KB) es/disclaim_threshold_MB = 12000(OS memory release for >12GB) es/disclaim_coasting_time_alloc = 300(coasting time for OS release when allocating memory) es/disclaim_coasting_time_alloc = 60(coasting time for OS release when freeing up memory)
Page 10 of 10