In SAP the memory management system assigns memory to a work
process. Each Work Process has its own local memory to perform functions. It contain ABAP Executable, Buffer for atabase !ransfer, "ocal #oll area. !o optimi$e the performance of SAP Systems , it is necessary to un%erstan% &emory &anagement in SAP Definition of Virtual Memory' ( When system memory runs low, Application uses space allocate% from the har% %isk %ri)e to act as #A&. !his is the *)irtual memory.* !he maximum amount of allocate% space is usually e+ual to half the amount of #A& installe%. !his gi)es the computer ,-percent more memory to run applications. Maximum virtual memory >= physical memory + operating system swap space Definition of Shared Memory:- If se)eral processes are to access the same memory area, both allocation steps are not transparent. .ne ob/ect is create% that represents the physical memory an% can be use% by )arious processes. !he processes can map the ob/ect fully or partially into the a%%ress space. !he way this is %one )aries from platform to platform. &emory mappe% files, unname% mappe% files, an% share% memory are use%. R/3 Buffer' ( #01 Buffer is the part of Exten%e% &emory. It is accessible to all the work process of same application ser)er. #01Buffer contains global ob/ects such as Programs, 2ustomi$ing !ables, etc. 3ollowing are the Parameters for the same' ( abap/heap_area_dia'( efines the limit for the amount of local memory allocate% to %ailog work processes. abap/heap_area_nondia'( efines the limit for the amount of local memory allocate% to non(%ialog work processes. abap/heap_area_total'( efines the limit for the total amount of heap memory allocate% to all work processes. Extended Memory'( Exten%e% &emory also comes un%er Share% &emory. It maintains 1:n relation with work processes. Exten%e% &emory contains 4ser 2ontext ata. 3ollowing are the Parameters for the same'( ztta/roll_extension'( efines the user +uota for exten%e% memory em/initial_size_MB'( efines the fixe% si$e of exten%e% memory Heap Memory'( When your Exten%e% &emory is full, Work Process start using 5eap &emory i.e., Pri)ate &emory. .ther processes cannot use Pri)ate 6heap7 memory. After releasing the assigne% memory, the operating system still consi%ers the 6)irtual7 memory as being occupie% by the allocating process. !he SAP system offers a mechanism that let you terminate non(acti)e %ialog processes in the P#I8 mo%e. !his mechanism helps re%uce performance problems. abap/heaplimit ( !his )alue specifies the memory amount in bytes. When this amount is excee%e%, a work process is restarte% after executing a %ialog step. Roll Memory'( When the context of a work process changes, the %ata is copie% from the roll area to a common resource calle% the roll file. !o pre)ent repeate% copying, another roll buffer is locate% in between that is part of the share% memory. 3ollowing are the Parameters for the same'( ztta/roll_first'( efines the first part of the roll area that is allocate% to a %ialog process ztta/roll_area'( efines the total roll area per work process zdisp/roll_SHM'( efines the si$e of the roll buffer. rdisp/roll_MAXFS'( efines the si$e of roll buffer an% roll file. ztta/roll_extension'( efines the user +uota for exten%e% memory Paging Memory'( #01 Paging &emory contains ABAP .b/ects Extracts an% Exports. 3ollowing are the parameters for the same ( rdisp/PG_SHM'( Paging Buffer Si$e rdisp/PG_MAXFS'( &aximum Si$e of the SAP Paging 3ile 5ere the below fin% the complete picture of #01 &emory System point of 8iew. R/3 memory Allocation User ontext Data! " In an #01 System, many front(en% users are connecte% to one are more application ser)ers. !he work that users re+uest from the system is performe% in work processes. 9ormally, there are fewer work processes than front(en% users. A work process is %e%icate% to a front(en% user only while a specific %ialog step is being processe% by the application ser)er. A user can be %ispatche% to one work process in one %ialog step, an% to another work process in the following %ialog step. .)er the course of time, users are %ispatche% to %ifferent work processes. In the course of thier work in %ialog work processes, users accumulate )arious pieces of %ata, such as pointers to programs they are using. !his accumulate% %ata is calle% the *user context*. A user context enables, for example, the material number you are working on to be remembere% by the system an% propose% as the %efault in a following transaction. !he mechanism known as a *roll out* ensures that when user : nee%s to use the work process which has /ust been use% by user ;, the user context %ata of user ; is not be lost or o)erwritten. !he roll out sa)es the user context %ata for the %ialog user when he or she exits the work process. Work process ; is occupie% by another user. When user ;, who was formerly working in work process ;, is therefore %ispatche% to work process :, the user context %ata is copie% into work process : by the mechanism known as a *roll in*. 4ser ; can thus continue from where he or she stoppe% in the earlier work process. !he %ata processe% in work processes is store% in two memory areas' < !he roll area, in which user context %ata is store%. 4ser context %ata may inclu%e pointers to acti)e programs, set0get parameters 6relate% to the most recent input of the user7, authori$ations, internal tables, an% report lists. < !he paging area, which stores the application program %ata that correspon% to specific ABAP comman%s inclu%ing E=!#A2!, I&P.#! !. &E&.#>, E=P.#! 3#.& &E&.#>, an% 2A"" !#A9SA2!I.9. :. !he si$e of these areas is configurable using #01 profile parameters. 1 Wher e there is buffer space a)ailable, the roll area an% the paging area are hel% in the respecti)e buffers in the application ser)ers. When there is not sufficient buffer space, the roll area an% the paging area must be store% in the respecti)e physical %isk files 6roll file an% paging file7. 2 !hus, the user %ata processe% in work processes is store% in two areas' !he roll file an% its associate% buffer < !he page file an% its associate% buffer 4ser contexts are not only store% in roll files an% the correspon%ing buffers. As of #01 #elease 1.-, they are primarily store% in #01 exten%e% memory. In #01 exten%e% memory, a large area of memory share% by all a)ailable work processes can be accesse% through pointers. 4sing exten%e% memory as well as roll files thus re%uces the amount of copying from roll areas that is re+uire% %uring user context switches, an% a)oi%s the o)erhea% cause% by large roll(in or roll(out tasks. Note : - 3 In #01 memory management' Work processes ser)e a large number of fronten% users Each work process must be capable of loa%ing the user context %ata for successi)e fronten% users :. !he roll %ata an% paging %ata is copie% to the roll buffer an% paging buffer an% the correspon%ing files when a user lea)es the work process. 1. #01 exten%e% memory uses mapping instea% of copying an% therefore allows' 3ast access to internal tables an% lists through pointers ?uick context switches 4sage of har%ware with large memory #e%uce% loa% on 2P4 an% %isk @. #01 exten%e% memory re+uires sufficient physical memory Allocation se#uence for dialog $or% processes !o keep the usage of the roll area to a minimum an% make more use of exten%e% memory, only a small portion of the roll area is use% initially. !he si$e of this portion is set by the parameter ztta/roll_first. 9ote' In%epen%ent of parameter ztta/roll_first, there is a minimum amount of roll area that is always use%. 3or example, if ztta/roll_first is set to ;, not /ust one byte is allocate%, but the minimum amount re+uire% for a%ministrati)e %ata. Exten%e% memory enables the %ata to be store% in your system, where it is efficiently accesse% by pointers rather than by a copy process. !he exten%e% memory per user may )ary from ; &B to se)eral ;-- &B. !he user +uota %efines the maximum amount of #01 exten%e% memory that can be use% by any one user, an% is set with the parameter $tta0rollAextension. !he user +uota thus pre)ents one user from occupying all a)ailable exten%e% memory.
!he remaining portion of #01 roll memory is use% when the system can no longer allocate #01 exten%e% memory, either because #01 exten%e% memory is full or because the +uota has been reache%. !he reason for using the remaining portion of #01 roll memory is to a)oi% using heap memory, which is local memory, an% a)oi% entering P#I8 mo%e 6see below7. If the work process re+uires still more space after using up all a)ailable roll area an% exten%e% memory, the system is force% to allocate #01 heap memory locally. 5ea p memory allocate% by one work process is not accessible to any other work process. !his means that a user is unable to continue the transaction in a %ifferent work process. !he user is now effecti)ely locke% to the work process. !his situation is calle% P#I8 mo%e. %ialo g process that was force% to allocate #01 heap memory automatically enters P#I8 mo%e. While a user is in a transaction which cause% the work processes to enter P#I8 mo%e, no other user can access the work process. Since #01 architecture uses a limite% number of work processes to satisfy a larger number of fronten% users, other users suffer when a user goes into P#I8 mo%e. If se)eral users go into P#I8 mo%e, they can work well, but other users can har%ly work at all. ata in #01 roll memory is copie% %uring context switch. ata in #01 exten%e% memory is mappe% %uring context switch. ata in #01 heap memory can ne)er lea)e the work process. If heap memory is allocate%, the work process is exclusi)ely assigne% to one user in P#I8 mo%e. 9ote' the se+uence in which memory is use% by work processes is not %etermine% by the amount memory initially allocate%. !hus, while the entire roll memory is allocate% on work process start, it is not initially use% up completely. Allocation Sequence for Dialog WPs - Summary !he memory allocation strategy for %ialog work processes aims to pre)ent work processes from allocating #01 heap memory an% thus entering P#I8 mo%e. When a work process enters P#I8 mo%e, it remains connecte% to the user until the user en%s the transaction. Allocation se#uence for non"dialog $or% processes ata in #01 roll memory is copied %uring context switch. ata in #01 exten%e% memory is mapped %uring context switch. ata in #01 heap memory can ne)er lea)e the work process. If heap memory is allocate%, the work process is exclusi)ely assigne% to one user in P#I8 mo%e. Note:the se+uence in which memory is use% by work processes is not %etermine% by the amount memory initially allocate%. !hus, while the entire roll memory is allocate% on work process start, it is not initially use% up completely. Random access memory &RAM' is physical memory that hol%s the applications, %ocuments an% proce%ures on a computer. 8irtual memory is a storage area that hol%s the files on your har% %ri)e for retrie)al when a computer runs out of #A& P(ysical Memory' ( Physical memory is the #A& chips purchase% an% place% in a slot on the computer motherboar%. !he #A& is the first memory use% when the computer re+uires memory usage, such as for loa%ing an application or opening a %ocument. )irtual Memory: - 8irtual memory is store% on the har% %ri)e. 8irtual memory is use% when the #A& is fille%. 8irtual memory is slower than physical memory, so it can %ecrease the performance of applications. P(ysical Memory Si*e' ( Physical memory is limite% to the si$e of the #A& chips installe% in the computer. 8irtual memory is limite% by the si$e of the har% %ri)e, so )irtual memory has the capability for more storage. +(at ,s t(e )irtual Memory S$ap -ile. #an%om access memory or #A& is a computerBs physical system memory. !he physical memory is use% to run applications. When this memory is o)ertaxe%, the computer relies on )irtual memory to help run programs )irtual Memory: - When system memory runs low, Win%ows uses space allocate% from the har% %isk %ri)e to act as #A&. !his is the *)irtual memory.* !he maximum amount of allocate% space is usually e+ual to half the amount of #A& installe%. !his gi)es the computer ,- percent more memory to run applications. S$apping: - When #A& space becomes a)ailable, the memory management unit 6&&47 swaps the temporary files back into physical memory files. !he act of mo)ing the files is known as *swapping* or *paging.*