SAP Memory

SAP Memory


MEMORY:
àMemory is assigned to the work process to roll in the user context into task handler.

àDepending up on the user request the memory is allocated to the process ID up to a max of
    2GB to 4GB. The OS command “memlimits” specifies the maximum amount of memory a 
    process can be allocated.

Physical Memory:
   The memory that is available (installed) on the system. If more than one instance is installed on the same machine then the parameter PHYS_MEMSIZE determines the amount of memory that can be used by the instance.

Virtual memory: 
   The physical memory is not sufficient to handle the memory requirement of the SAP instance. So it is recommended to configure virtual memory (SWAP/PAGE) on the disk. It is around three times the size of physical memory on 32bit machines. And minimum 20GB is required for 64 bit machines.

32/64 bit Machines:
    32 bit systems were once desired because they could address up to 4GB of memory in one go. Some modern applications require more than 4GB of memory to complete their tasks so 64bit systems are now becoming more attractive because they can potentially provide more than 4GB of memory to complete the task.

àMore bits means that data can be processed in large chunks, which also means more  
    accurately.

àMore bits means other system can point to or address a large number of locations in physical
    memory and with faster speed.

Extended Memory:
   The memory that is exclusively used by the SAP R3 work process is referred as extended memory.

Roll Memory / Local Memory:
    The memory that is extensively dedicated to a work process user context referred as roll memory.

Shared Memory:
   The memory that is used by the entire instance for R3 work processes, buffers and kernel etc…


Heap Memory:
   If the extended memory is fully occupied, or the limit for the work processes has been exceeded, the work process allocates heap memory because it is specific to the process.

Heap Memory:
   If the extended memory is fully occupied, or the limit for the work processes has been exceeded, the work process allocates heap memory because it is specific to the process.

Memory allocation to dialog process: 
       
Sequence in which memory allocated (dialog process):
Memory allocation sequence to dialog work process in SAP:

1.      Initially a dialog roll area is used. The roll area is defined by the sap parameter ztta/roll_area. The part of the roll area which is defined by parameter
            Ztta/roll_first = 20kb is used initially before start using extended memory.

2.      Extended memory is used until the extended memory is full or until the user quota is reached. Extended memory is defined by the parameter em/initial_size_mb, and the user quota for dialog work process is defined by the parameter ztta/roll_extension_dia.

3.      If this memory also not sufficient then, the rest of the roll area is used .This rest of the memory area is configured by using the difference between ztta/roll_area - ztta/roll_first.

4.      Once this is also fully occupied then, the statement is forced to use local heap memory (Private memory) which is configured by parameter “abap/heap_area_dia” and the work process goes into private mode. Heap (local/private) memory is available until one of the following occurs.

Either the limit of the heap memory for dialog work process is  
                 reached (abap/heap_area_dia) or the entire heap memory of all work processes
                (abap/heap_area_total) for an application server reaches its limit.
           
            àOS limit for allocation of memory.
      
            àThe SWAP space in the host system is used up or the upper limit of the OS address 
                Space is reached.

            àThe task is completed or the process is timed out by parameter
                rdisp/max_priv_time = 60sec. The work process cannot terminated by the  
                Parameter rdisp/max_wprun_time when a work process enters private mode, it
                Remains connected to the user until the user ends the transaction or it is timed out by
                the system due to memory or explicitly logged out the user using SM04 / DPMON/  
                SM50.
    


            User complains that they could not access the system (globally), users are encountering hour glass mode and transactions SM50/SM66/SM21/SM04 are not accessible.

àCheck the system status using dpmon/sapmmc.

àIdentify the process that has been in logged for longer time.

àKill the process (if dpmon could not kill) then use “task handler” on windows or “kill”
    command in UNIX.

àRestrict the process that goes into work process private mode by using parameter
    rdisp/wppriv_max_no = 1 or 2. And set the parameter rdisp/max_priv_time = 60sec to 
    terminate the processes that are in private mode for longer than 60 sec.


Monitoring Memory:
àExecute ST02 for roll, extended and heap memory usage. (Instance specific run time
     Memory).

àExecute SM04 for identifying the memory usage by user sessions (Instance specific).
   
àExecute ST03N to identify the memory used by program/transactions/btc/user jobs.

àExecute SM66 to identify runtime memory consumed by process.

Initially a defined roll area is used. This roll area is defined by SAP parameter Ztta/roll_area. 
    The complete roll area which is defined by parameter ztta/roll_area = 6MB is used initially 
    before start using heap memory.

àHeap memory is defined by parameter abap/heap_area_nondia. If it is not sufficient then it

    uses extended memory.
Extended memory is defined by parameter ztta/role_extention_nondia.



The factors that affect the memory on the system are:

àProgram errors (Ex: endless loop , expensive sql statements).

àSAP profile parameters are set incorrectly.

àThe swap space on the OS is not large enough.

àConfiguration parameters of the OS are set incorrectly or OS limits have been reached
    (Configure OS kernel parameters).

         The memory of user context is used up and the following are the errors which are thrown into ABAP dumps.

  1. STORAGE_PARAMETERS_WRONG_SET

  1. SYSTEM_ROLL_IN_ERROR

  1. TSV_TNEW_BLOCKS_NO_ROLL_MEMORY

  1. TSV_TNEW_PAGE_ALLOC_FAILED

  1. TSV_TNEW_INDEX_NO_ROLL_MEMORY

  1. SYSTEM_NO_MORE_PAGING


àPXA_NO_SHARED_MEMORY: System cannot create the program buffer, because there
    is no sufficient shared memory at that time.

àThe program encounters a memory bottle neck during an operation in the database interface              
     DBIF _RTAB_NO_MEMORY, DBIF _RSQL_NO_MEMORY.

àThe program encounters a memory bottle neck during sorting
     EXSORT_NOT_ENOUGH_MEMORY.




Comments

Popular posts from this blog

SAP NWA: Net Weaver Administration Tool

Advanced JAVA

SAP BASIS SPOOLING : Printing problems and general issues