SAPMemoryManagement anoverview
[email protected]
SAPMemoryManagement SAPMemoryareasoverview: § SAPBuffer § SAPRollMemory § SAPExtendedMemory § SAPHeapMemory § SAPPagingMemory § FixedLocalMemoryoftheSAPworkProcess MainfactorsinconfiguringSAPMemory: u PhysicalMainMemory(RAM) àgiveaIenJontoraJobetweenphysicalandvirtualmemory u OperaJngsystemopJonsandrestricJons àcomparebetween32and64bitsystemarchitecture
MemoryManagementFundamental Theword“memory” àvirtualmemory àphysicalmainmemory+swapspace àlocalmemory+sharedmemory Themaximumamountofvirtualmemorythatcanbeallocatedislimitedbytwovariable: § ResultofphysicalhardwarerestricJon § MaximumaddressspacepermitedbyoperaJngsystem TheOperaJngSystemmanagestwotypeofmemory: u Localmemory àallocatedpreciselytooneoperaJngsystemprocess u Sharedmemory àaccessibletomulJpleoperaJngsystemprocess
UserContext Reffered: Ø DatawhichisgeneratedbytransacJonprocess Ø Variables,nternaltable&screenlist Ø Newsesion=newusercontext Ø Dataisstoredindependentlyindifferentmemoryareas Ø StoredinSAProllmemory,SAPextendedmemory,&SAPHeapMemory Sesionsdivideinto: q Externalsesionàopenedexplicitlybyuser q nternalsesionàopenedimplicitlybyprogram submit,calltransac.on,calldialog,callscreen,callfunc.oninupdatetask,callfunc.onin backgroundtask,andcallfunc.onstar.ngnewtask
ProcessFlow Pres. server
SAP ApplicaJon Sever
DB Server
Table buffer Program SAPExtendedMemory
I U G P A S
Dispatcher Queue
r e h c t a p s i d
buffer
Database
DDCBuffer
buffer
SAPRollMemory WorkProcess
DBProcess
WorkProcess
DBProcess
WorkProcess
DBProcess
SAPRollMemory LocalSAPRollareaofworkprocess § TheiniJalpartofusercontextstored § EachSAPworkprocesscanonlyaccessitsownrollarea SharedSAPRollArea § Accessibletoallofinstanceworkprocesses § Buffertotemporarykeepusercontextwhenauserisassignedtonewworkprocess
Rollin
àcopyingusercontextfromsharedrollareatolocalrollarea
RollOutàcopyingusercontextfromlocalrollareatosharedrollarea
Roll buffer (shared memory) Roll area (local)
Roll area (local) copy
copy
Work Process1
Roll file (disk)
Roll Buffer (shared)
ztta/roll_first Roll (local) ztta/roll_area
Work Process2
rdisp/roll_SHM
Roll In / Roll Out Roll file
rdisp/roll_MAXFS
SAPRollAreaParameters zIa/roll_first àfirstamountofrollareausedinadialogworkprocess zIa/roll_area àsizeofthelocalSAPRollareaintheworkprocess rdisp/ROLL_SHM àsizeofSAProllBuffer rdisp/ROLL_MAXFS àsizeofenJresharedSAProllarea
SAPExtendedMemory o
o
o
o
Sharedmemorywhichmostlyofusercontextstored AllSAPworkprocesscaneditstoredusercontextdirectly Rollinratheronlycopiedtheaddress(pointer)ofwhereausercontextlocatedontheSAP extendedmemory Makesrollprocessmuchfaster
em/initial_size_MB
ztta/roll_extension
SAPExtendedMemoryMainParameters em/iniJal_size_MB à sizeofSAPextendedmemoryallocatedwhentheSAPinstancestarts up em/blocksize_KB à sizeblockwhichsplitSAPExtendedMemory zIa/roll_extension à maximumsizeofausercontextintheSAPExtendedmemory
SAPHeapMemory § §
Areawhichallocatedvariablyaslocalmemoryasrequired. ReleasedaeratransacJoniscomplete.
SAPHeapMemoryMainParameters abap/heap_area_dia à quotasofSAPheapmemorythatadialogprocesscanallocated. abap/heap_area_nondia à quotasofSAPheapmemorythatanondialogprocesscanallocated. abap/heap_area_total à sizethatcanbeallocatedintotalbyallworkprocess. abap/heaplimit à workprocessrestartlimitofheapmemory.
Heap Memory (local)
abap/heap_area_(non)dia abap/heap_area_total
Sequenceinwhichmemoryisallocated (dialogworkprocess) User Context UserIndependent Data
1
2
3
4
Roll memory to
Roll memory to
Roll memory to
Roll memory to
zttz/roll_first
zttz/roll_extension
zttz/roll_area
abap/heap_area_dia
Copying data during context change
Mapping the data during context change
- Data stays in work process - No context switch possible - Work process in private mode
Sequenceinwhichmemoryisallocated (non-dialogworkprocess) User Context UserIndependent Data
1
2
3
Roll memory to
Roll memory to
Roll memory to
zttz/roll_area
abap/heap_area_dia
zttz/roll_extension
Copying data during context change
Mapping the data during context change - Data stays in work process - No context switch possible - Work process in private mode
SAPExtendedGlobalMemory Datacanbestoredgloballybetweenusercontext q Usedtostoredataacrossusercontext q Allowsfast©-freeswitchingbasedonmapping. q SubstractedfromSAPExtendedMemorytocalculatetheremainingstorage space q Configuredusingem/global_area_MBparameters q
SAPPagingMemory ObjectthatstoredintheSAPPagingMemory: § ABAPdataclusterstoredtemporarilywithABAPstatement MPORT/EXPORTFROM/TOMEMORY §
§
ParametertransferredwhenprogramsandtransacJoncalled SUBMTREPORT,CALLTRANSACTON,CALLDALOG,CALLSCREEN,CALLFUNCTONNUPDATE TASK,CALLFUNCTONBACKGROUNDTASK,CALLFUNCTONSTARTNGNEWTASK DataextractscreatedbystatementEXTRACT(uptobasis4.5)
SAPPagingMemoryMainParameters: rdisp/PG_MAXFS àsizeofSAPPagingMemory àsizeofSAPPagingBuffer(sharedmemory) rdisp/PG_SHM o o
ErrorcausedbySAPPagingMemory: u TSV_TNEW_PG_CREATE_FALED u SYSTEM_NO_MORE_PAGNG
GlobalvsLocalMemory Server
Global Memory (shared memory)
Local memory
SAP buffers
Additional local
(contains e.g SAP Programs)
heap memory (if required)
SAP roll buffer Extended Memory SAP paging buffer
(User Context)
Local
Local
Local
memory
memory
memory
1:1
1:n SAP Roll File SAP Paging File
Work
Work
Work
Process
Process
Process
Configuring&MonitoringSAPMemory Areas MainObjecJve: Ø Performance Ø Stability MainFactorstobeconsidered: Ø PhysicalMainMemory(RAM) Ø SwapspaceorpagingfileoftheoperaJngsystem Ø OperaJngsystemrestricJon
NextPointtobeConsidered TotalMainMemoryRequirement q NumberofComputer q SeveralSAPinstancespercomputer q SAPextendedmemoryandrollbuffer q MemoryforSAPworkprocess q Databasenstance q
ZeroadministraJonmemorymagement: PHYS_MEMSZEparameterdefineshowmuchofacomputer’stotalphysical memoryshouldbeusedfortheSAPinstance.
AddressSpaceRestricJon(UNX) em/initial_size_MB User Context
User Independent WP Local
abap/heap_area_(non_)dia
SAP
Roll
SAP Extended Memory
SAP Heap Memory
Buffers
Memory
(Shared)
(local)
(Shared)
(Shared)
Address Space SAP Work Process
AddressSpaceRestricJon(Windows) em/initial_size_MB SAP Extended Memory Total
em/address_space_MB User Context
User Independent WP Local
abap/heap_area_(non_)dia
SAP
Roll
SAP Extended Memory
SAP Heap Memory
Buffers
Memory
(Shared)
(local)
(Shared)
(Shared)
Address Space SAP Work Process
AssistanceWithTroubleshooJng ErrorbecauseofincorectmemoryareaconfiguraJon: § OperaJngSystemcannotstartbecausetheoperaJngsystemcannot providetherequstedmemoryarea § SessionterminaJonsàuserisloggedoff § ABAPProgramterminaJon. Fourerrorfactors: Ø Programerrors(e.gendlessloop) Ø SAPProfileparametersaresetincorectly Ø TheSwapSpaceontheoperaJngsystemisnotlargeenough Ø ConfiguraJonparametersoftheoperaJngsystemaresetincorectlyorOS limitshavebeenreached.
ABAPProgramTerminaJon ²
²
²
²
²
²
²
²
Thememoryofusercontextisusedup STORAGE_PARAMETERS_WRONG_SET,SYSTEM_ROLL_N_ERROR,TSV_TNEW_BLOCKS_NO_ROLL_MEMORY, TSV_TNEW_PAGE_PAGE_ALLOC_FALED,TSV_TNEW_NDEX_NO_ROLL_MEMORY SystemcannotcreatetheprogrambufferbecausethereisnotnotsufficientsharedmemoryatthatJme PXA_NO_SHARED_MEMORY TheProgramencountersamemoryboIleneckduringanoperaJoninthedatabaseinterface DBF_RTAB_NO_MEMORY,DBF_RSQL_NO_MEMORY TheProgramencountersamemoryboIleneckduringsorJng. EXSORT_NOT_ENOUGH_MEMORY AIemptocreateerrorlogfailsaeraterminatedprogramduetolackofmemory. RABAX_CALLNG_RABAX TheSAPpagingmemoryisusedup SYSTEM_NO_MORE_PAGNG,TSV_TNEW_PAGE_ALLOC_FALED ThememoryforSET/GETparameter(SPA/GPAmemory)isusedup. SET_PARAMETER_MEMORY_OVERFLOW Volumelimitofmemoyallocatedtosinglecall(zIa/max_memreq_MB)issettoolow SYSTEM_NO_ROLL