2 SAP Memory Management SAP Memory areas overview : SAP Buffer SAP Roll MemorySAP Extended MemorySAP Heap MemorySAP Paging MemoryFixed Local Memory of the SAP work ProcessMain factors in configuring SAP Memory :Physical Main Memory (RAM) give attention to ratio between physical and virtual memoryOperating system options and restrictions compare between 32 and 64 bit system architecture
3 Memory management fundamental : The word “memory” virtual memory physical main memory + swap space local memory + shared memoryThe maximum amount of virtual memory that can be allocated is limited by two variable :Result of physical hardware restrictionMaximum address space permited by operating systemThe Operating System manages two type of memory :Local memory allocated precisely to one operating system processShared memory accessible to multiple operating system process
4 User ContextReffered :Data which is generated by transaction processVariables, Internal table & screen listNew sesion = new user contextData is stored independently in different memory areasStored in SAP roll memory, SAP extended memory, & SAP Heap MemorySesions divide into :External sesion opened explicitly by userInternal sesion Opened implicitly by programsubmit, call transaction, call dialog, call screen, call function in update task, call function in background task, and call function starting new task.
5 Pres. server SAP Application Sever DB Server SAP GUI Process Flow SAP Extended MemoryDispatcher QueueSAP Roll MemorydispatcherTablebufferProgramDDIC BufferWork ProcessDB ProcessDatabaseProcess Flow
6 SAP Roll MemoryLocal SAP Roll area of work process- The initial part of user context stored- Each SAP work process can only access its own roll areaShared SAP Roll Area- Accessible to all of instance work processes- Buffer to temporary keep user context when a user is assigned to new work processRoll in : copying user context from shared roll area to local roll areaRoll Out : copying user context from local roll area to shared roll area
7 Roll buffer (shared memory) Roll area (local)Roll file (disk)Work Process1Work Process2copyRoll fileRoll (local)Roll Buffer (shared)Roll In / Roll Outrdisp/roll_SHMrdisp/roll_MAXFSztta/roll_firstztta/roll_area
8 SAP Roll area parameters - ztta/roll_first : First amount of roll area used in a dialog WP- ztta/roll_area : size of the local SAP Roll area in the work processrdisp/ROLL_SHM : size of SAP roll Bufferrdisp/ROLL_MAXFS : size of entire shared SAP roll area
9 SAP Extended MemoryShared memory which mostly of user context storedAll SAP work process can edit stored user context directlyRoll in rather only copied the address (pointer) of where a user contextlocated on the SAP extended memory.makes roll process much fasterztta/roll_extensionem/initial_size_MB
10 SAP Extended Memory main parameters : em/initial_size_MB : size of SAP extended memory allocated when the SAP instance starts upem/blocksize_KB : size block which split SAP Extended Memoryztta/roll_extension : maximum size of a user context in the SAP Extended memory
11 Area which allocated variably as local memory as required. SAP Heap MemoryArea which allocated variably as local memory as required.Released after a transaction is complete.SAP Heap Memory main parameters :abap/heap_area_dia : quotas oh SAP heap memory that a dialog process can allocated.abap/heap_area_nondia : quotas oh SAP heap memory that a nondialog process can allocated.abap/heap_area_total : size that can be allocated in total by all work process.abap/heaplimit : Workprocess restart limit of heap memoryHeap Memory (local)abap/heap_area_(non)diaabap/heap_area_total
12 User-Independent Data Sequence in which memory is allocated (dialog work process) :User-Independent DataRoll memory tozttz/roll_firstzttz/roll_extensionzttz/roll_areaabap/heap_area_dia1234User ContextCopying data during context changeMapping the data during context changeData stays in work processNo context switch possibleWork process in private mode
13 User-Independent Data Sequence in which memory is allocated (non-dialog work process) :User-Independent DataRoll memory tozttz/roll_extensionzttz/roll_areaabap/heap_area_dia123User ContextCopying data during context changeMapping the data during context changeData stays in work processNo context switch possibleWork process in private mode
14 SAP EG Memory and SAP Paging Memory Data can be stored globally between user contextSAP Extended Global MemoryUsed to store data across user contextAllows fast & copy-free switching based on mapping.Substracted from SAP Extended Memory to calculate the remainingstorage spaceconfigured using em/global_area_MB parameters
15 Object that stored in the SAP Paging Memory : ABAP data cluster stored temporarily with ABAP statementIMPORT/EXPORT FROM/TO MEMORYParameter transferred when programs and transaction calledSUBMIT REPORT, CALL TRANSACTION, CALL DIALOG, CALL SCREEN, CALL FUNCTION IN UPDATE TASK, CALL FUNCTION BACKGROUND TASK, CALL FUNCTION STARTING NEW TASK Data extracts created by statement EXTRACT (up to basis 4.5)SAP Paging Memory Main Parameters :rdisp/PG_MAXFS : Size of SAP Paging Memoryrdisp/PG_SHM : Size of SAP Paging Buffer (shared memory)Error caused by SAP Paging Memory :TSV_TNEW_PG_CREATE_FAILEDSYSTEM_NO_MORE_PAGING
16 Global Memory (shared memory) Local memory ServerGlobal Memory (shared memory)Local memorySAP buffers(contains e.g SAP Programs)Additional localheap memory (if required)SAP roll bufferExtended Memory(User Context)LocalmemoryLocalmemoryLocalmemorySAP paging buffer1 : 11 : nSAP Roll FileWorkProcessWorkProcessWorkProcessSAP Paging File
17 Configuring & Monitoring SAP Memory Areas Main Objective : Performance StabilityMain Factors to be considered :Physical Main Memory (RAM)Swap space or paging file of the operating systemOperating system restriction
18 Next points to be considered : Total Main Memory Requirement Number of ComputerSeveral SAP instances per computerSAP extended memory and roll bufferMemory for SAP work processDatabase InstanceZero administration memory magement :PHYS_MEMSIZE parameter defines how much of a computer’s total physical memoryshould be used for the SAP instance.
19 Address Space Restriction (Unix) User IndependentWPLocalSAPBuffers(Shared)User ContextRollMemorySAP Extended MemorySAP Heap Memory(local)em/initial_size_MBabap/heap_area_(non_)diaAddress SpaceSAP Work Process
20 SAP Extended Memory Total Address Space Restriction (Windows)User IndependentWPLocalSAPBuffers(Shared)User ContextRollMemorySAP Extended MemorySAP Heap Memory(local)em/address_space_MBabap/heap_area_(non_)diaAddress SpaceSAP Work ProcessSAP Extended Memory Totalem/initial_size_MB
21 Assistance With Troubleshooting Error because of incorect memory area configuration :Operating System can not start because the operating systemcannot provide the requsted memory areaSession terminations User is logged offABAP Program termination.Four error factors :Program errors (e.g endless loop)SAP Profile parameters are set incorectlyThe Swap Space on the operating system is not large enoughConfiguration parameters of the operating system are set incorectlyor OS limits have been reached.
22 ABAP Program Termination : The memory of user context is used up :STORAGE_PARAMETERS_WRONG_SET, SYSTEM_ROLL_IN_ERROR,TSV_TNEW_BLOCKS_NO_ROLL_MEMORY, TSV_TNEW_PAGE_PAGE_ALLOC_FAILED,TSV_TNEW_INDEX_NO_ROLL_MEMORYSystem can not create the program buffer because there is not not sufficient shared memory at that timePXA_NO_SHARED_MEMORYThe Program encounters a memory bottleneck during an operation in the database interfaceDBIF_RTAB_NO_MEMORY, DBIF_RSQL_NO_MEMORYThe Program encounters a memory bottleneck during sorting.EXSORT_NOT_ENOUGH_MEMORYAttemp to create error log fails after a terminated program due to lack of memory.RABAX_CALLING_RABAXThe SAP paging memory is used upSYSTEM_NO_MORE_PAGING, TSV_TNEW_PAGE_ALLOC_FAILEDThe memory for SET/GET parameter (SPA/GPA memory) is used up.SET_PARAMETER_MEMORY_OVERFLOWVolume limit of memoy allocated to single call (ztta/max_memreq_MB) is set too lowSYSTEM_NO_ROLL