sap memory management

24
SAP Memory Management an overview [email protected] [email protected]

Upload: papalinux

Post on 03-Jan-2016

68 views

Category:

Documents


8 download

DESCRIPTION

SAP Memory Management

TRANSCRIPT

Page 1: SAP Memory Management

SAP  Memory  Management  an  overview  

[email protected]  

[email protected]  

Page 2: SAP Memory Management

SAP  Memory  Management  SAP  Memory  areas  overview  :  §  SAP  Buffer  §  SAP  Roll  Memory  §  SAP  Extended  Memory  §  SAP  Heap  Memory  §  SAP  Paging  Memory  §  Fixed  Local  Memory  of  the  SAP  work  Process    Main  factors  in  configuring  SAP  Memory  :  u  Physical  Main  Memory  (RAM)              à  give  aIenJon  to  raJo  between  physical  and  virtual  memory  u  OperaJng  system  opJons  and  restricJons              à  compare  between  32  and  64  bit  system  architecture    

[email protected]  

Page 3: SAP Memory Management

Memory  Management  Fundamental  The  word  “memory”  à  virtual  memory  

   à  physical  main  memory  +  swap  space        à  local  memory  +  shared  memory  

 The  maximum  amount  of  virtual  memory  that  can  be  allocated  is  limited  by  two  variable  :  §  Result  of  physical  hardware  restricJon  §  Maximum  address  space  permited  by  operaJng  system    The  OperaJng  System  manages  two  type  of  memory  :  u  Local  memory            à  allocated  precisely  to  one  operaJng  system  process  u  Shared  memory            à  accessible  to  mulJple  operaJng  system  process      

[email protected]  

Page 4: SAP Memory Management

User  Context  Reffered  :  Ø  Data  which  is  generated  by  transacJon  process  Ø  Variables,  Internal  table  &  screen  list        Ø  New  sesion  =  new  user  context    Ø  Data  is  stored  independently  in  different  memory  areas  Ø  Stored  in  SAP  roll  memory,  SAP  extended  memory,  &  SAP  Heap  Memory    Sesions  divide  into  :  q  External  sesion    à    opened  explicitly  by  user  q  Internal  sesion    à  opened  implicitly  by  program    submit,  call  transac.on,  call  dialog,  call  screen,  call  func.on  in  update  task,    call  func.on  in  background  task,  and  call  func.on  star.ng  new  task    

[email protected]  

Page 5: SAP Memory Management

Process  Flow  

Pres.  server   SAP  ApplicaJon  Sever   DB  Server  

SAP  GU

I  

SAP  Extended  Memory  

Dispatcher  Queue  

SAP  Roll  Memory  

dispatcher  

Table  

buffer  

Program  

buffer  

DDIC  Buffer  

Work  Process  

Work  Process  

Work  Process  

DB  Process  

DB  Process  

DB  Process  

Database  

buffer  

[email protected]  

Page 6: SAP Memory Management

SAP  Roll  Memory  Local  SAP  Roll  area  of  work  process  §  The  iniJal  part  of  user  context  stored    §  Each  SAP  work  process  can  only  access  its  own  roll  area    Shared  SAP  Roll  Area  §  Accessible  to  all  of  instance  work  processes  §  Buffer  to  temporary  keep  user  context  when  a  user  is  assigned  to  new  work  process    Roll  in  à    copying  user  context  from  shared  roll  area  to  local  roll  area      Roll  Out  à    copying  user  context  from  local  roll  area  to  shared  roll  area      

[email protected]  

Page 7: SAP Memory Management

Roll file

Roll (local)

Roll Buffer (shared)

Roll In / Roll Out

rdisp/roll_SHM

rdisp/roll_MAXFS

ztta/roll_first

ztta/roll_area

Roll buffer (shared memory) Roll area

(local)

Roll file (disk)

Roll area (local)

Work Process1

Work Process2

copy copy

[email protected]  

Page 8: SAP Memory Management

SAP  Roll  Area  Parameters  zIa/roll_first  

 à  first  amount  of  roll  area  used  in  a  dialog  work  process  zIa/roll_area  

 à  size  of  the  local  SAP  Roll  area  in  the  work  process  rdisp/ROLL_SHM  

 à  size  of  SAP  roll  Buffer  rdisp/ROLL_MAXFS  

 à  size  of  enJre  shared  SAP  roll  area    

[email protected]  

Page 9: SAP Memory Management

SAP  Extended  Memory  o  Shared  memory  which  mostly  of  user  context  stored  o  All  SAP  work  process  can  edit  stored  user  context  directly  o  Roll  in  rather  only  copied  the  address  (pointer)  of  where  a  user  context  located  on  the  SAP  

extended  memory  o  Makes  roll  process  much  faster    

ztta/roll_extension

em/initial_size_MB

[email protected]  

Page 10: SAP Memory Management

SAP  Extended  Memory  Main  Parameters  em/iniJal_size_MB  

 à  size  of  SAP  extended  memory  allocated  when  the  SAP  instance  starts  up  

em/blocksize_KB    à  size  block  which  split  SAP  Extended  Memory  

zIa/roll_extension    à  maximum  size  of  a  user  context  in  the  SAP  Extended  memory    

[email protected]  

Page 11: SAP Memory Management

SAP  Heap  Memory  §  Area  which  allocated  variably  as  local  memory  as  required.  §  Released  ager  a  transacJon  is  complete.      

[email protected]  

Page 12: SAP Memory Management

SAP  Heap  Memory  Main  Parameters  abap/heap_area_dia  

 à  quotas  of  SAP  heap  memory  that  a  dialog  process  can  allocated.    abap/heap_area_nondia  

 à  quotas  of  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  memory.  

Heap Memory (local)

abap/heap_area_(non)dia

abap/heap_area_total

[email protected]  

Page 13: SAP Memory Management

Sequence  in  which  memory  is  allocated  (dialog  work  process)  

User-Independent

Data Roll memory to

zttz/roll_first Roll memory to

zttz/roll_extension

Roll memory to

zttz/roll_area

Roll memory to

abap/heap_area_dia

1 2 3 4User Context

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

[email protected]  

Page 14: SAP Memory Management

Sequence  in  which  memory  is  allocated  (non-­‐dialog  work  process)  

User-Independent

Data Roll memory to

zttz/roll_extension

Roll memory to

zttz/roll_area Roll memory to

abap/heap_area_dia

1 2 3User Context

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

[email protected]  

Page 15: SAP Memory Management

SAP  Extended  Global  Memory  q Data  can  be  stored  globally  between  user  context  q Used  to  store  data  across  user  context  q  Allows  fast  &  copy-­‐free  switching  based  on  mapping.  q  Substracted  from  SAP  Extended  Memory  to  calculate  the  remaining  storage  space  

q  Configured  using  em/global_area_MB  parameters  

[email protected]  

Page 16: SAP Memory Management

SAP  Paging  Memory  Object  that  stored  in  the  SAP  Paging  Memory  :  §  ABAP  data  cluster  stored  temporarily  with  ABAP  statement  

 IMPORT/EXPORT  FROM/TO  MEMORY  §  Parameter  transferred  when  programs  and  transacJon  called  

 SUBMIT  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  :  o  rdisp/PG_MAXFS  à    size  of  SAP  Paging  Memory  o  rdisp/PG_SHM  à    size  of  SAP  Paging  Buffer  (shared  memory)    Error  caused  by  SAP  Paging  Memory  :  u  TSV_TNEW_PG_CREATE_FAILED  u  SYSTEM_NO_MORE_PAGING  

[email protected]  

Page 17: SAP Memory Management

Global  vs  Local  Memory  

SAP paging buffer

SAP buffers

(contains e.g SAP Programs)

Extended Memory

(User Context)

Server

SAP roll buffer

Global Memory (shared memory) Local memory

Additional local

heap memory (if required)

Local

memory

Local

memory

Local

memory

SAP Roll File SAP Paging File

Work

Process

Work

Process

Work

Process

1 : n 1 : 1

[email protected]  

Page 18: SAP Memory Management

Configuring  &  Monitoring  SAP  Memory  Areas  Main  ObjecJve  :  Ø  Performance    Ø  Stability    Main  Factors  to  be  considered  :  Ø  Physical  Main  Memory  (RAM)  Ø  Swap  space  or  paging  file  of  the  operaJng  system  Ø  OperaJng  system  restricJon    

[email protected]  

Page 19: SAP Memory Management

Next  Point  to  be  Considered  q  Total  Main  Memory  Requirement          q Number  of  Computer    q  Several  SAP  instances  per  computer    q  SAP  extended  memory  and  roll  buffer  q Memory  for  SAP  work  process  q Database  Instance    Zero  administraJon  memory  magement  :  PHYS_MEMSIZE  parameter  defines  how  much  of  a  computer’s  total  physical  memory  should  be  used  for  the  SAP  instance.  

[email protected]  

Page 20: SAP Memory Management

Address  Space  RestricJon  (UNIX)  

User Independent

WP

Local

SAP

Buffers

(Shared)

User Context

Roll

Memory

(Shared)

SAP Extended Memory

(Shared)

SAP Heap Memory

(local)

em/initial_size_MB abap/heap_area_(non_)dia

Address Space

SAP Work Process

[email protected]  

Page 21: SAP Memory Management

Address  Space  RestricJon  (Windows)  

User Independent

WP

Local

SAP

Buffers

(Shared)

User Context

Roll

Memory

(Shared)

SAP Extended Memory

(Shared)

SAP Heap Memory

(local)

em/address_space_MB abap/heap_area_(non_)dia

Address Space

SAP Work Process

SAP Extended Memory Total

em/initial_size_MB

[email protected]  

Page 22: SAP Memory Management

Assistance  With  TroubleshooJng  Error  because  of  incorect  memory  area  configuraJon  :  §  OperaJng  System  can  not  start  because  the  operaJng  system  cannot  provide  the  requsted  memory  area  

§  Session  terminaJons    à    user  is  logged  off  §  ABAP  Program  terminaJon.    Four  error  factors  :  Ø  Program  errors  (e.g  endless  loop)  Ø  SAP  Profile  parameters  are  set  incorectly  Ø  The  Swap  Space  on  the  operaJng  system  is  not  large  enough  Ø  ConfiguraJon  parameters  of  the  operaJng  system  are  set  incorectly  or  OS  limits  have  been  reached.  

[email protected]  

Page 23: SAP Memory Management

ABAP  Program  TerminaJon  ²  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_MEMORY  

²  System  can  not  create  the  program  buffer  because  there  is  not  not  sufficient  shared  memory  at  that  Jme    PXA_NO_SHARED_MEMORY  

²  The  Program  encounters  a  memory  boIleneck  during  an  operaJon  in  the  database  interface    DBIF_RTAB_NO_MEMORY,  DBIF_RSQL_NO_MEMORY  

²  The  Program  encounters  a  memory  boIleneck  during  sorJng.    EXSORT_NOT_ENOUGH_MEMORY  

²  AIemp  to  create  error  log  fails  ager  a  terminated  program  due  to  lack  of  memory.    RABAX_CALLING_RABAX  

²  The  SAP  paging  memory  is  used  up    SYSTEM_NO_MORE_PAGING,  TSV_TNEW_PAGE_ALLOC_FAILED  

²  The  memory  for  SET/GET  parameter  (SPA/GPA  memory)  is  used  up.    SET_PARAMETER_MEMORY_OVERFLOW  

²  Volume  limit  of  memoy  allocated  to  single  call  (zIa/max_memreq_MB)  is  set  too  low      SYSTEM_NO_ROLL  

[email protected]