Friday, 23 February 2024

SAP Global Extended Memory (EG)

 


SAP Global Extended Memory (EG):
 
The v is part of the extended memory (EM). It contains user specific data and can be accessed by all work processes. The EG is a part of the EM, which is used for multiprocessing. The EG contains data that does not belong to a specific user session. This may be data used for example for monitoring and statistics, table buffers of the database interface (DBI), or ABAP-shared objects that all work processes have access to independently of the user session. You set the size of the EG in profile parameter 
em/global_area_MB. 



Reference:

  1. help.sap.com 
  2. SAP Notes 
  3. Linkedin

SAP Extended Memory (EM)

 


SAP Extended Memory (EM):

SAP Extended memory (EM) is the core of SAP Memory Management. The majority of data for a 
user session (user context), which different work processes access when processing requests, is 
stored here. These are mainly dialog work processes since this is where most user interaction 
with the system is processed. You set the size of the EM in profile parameter 
em/initial_size_MB. As of the release of SAP NetWeaver 7.4, the roll area was removed. 
Extended memory (EM) is now the actual memory for the application data. For more 
information, see SAP Note 2085980





Reference:
  1. help.sap.com 
  2. SAP Notes 
  3. Linkedin


Thursday, 22 February 2024

SAP Extended Segments Memory (ES)

 


SAP Extended Segments Memory (ES):

              SAP Extended segment memory (ES) forms the basis for extended memory (EM) and global extended memory (EG). The ES consists of a limited number of segments located next to each other and can be accessed by all work processes of an application server instance (AS instance). An ES segment consists of one or more ES blocks that are all the same size. The size of the blocks is configured in the profile parameter em/blocksize KB. The default value is 4 MB. When a user context requests a memory area from the EM, one or more blocks are allocated to the EM from the ES The ES blocks are stored in specific shared memory segments in the operating system. These segments are exclusively reserved for ES memory. How ES memory and therefore EM memory are implemented depends on the underlying operating system. 




Reference:

  1. help.sap.com 
  2. SAP Notes 
  3. Linkedin

SAP Shared Memory (SHM)

 



SAP Shared Memory (SHM):

SAP shared memory is a shared memory resource in SAP Memory Management in which various buffer data are stored. SAP SHM provides a shared memory that is shared by all work processes. It is based directly on the shared memory of the operating system. It comprises SAP SHM segments that are divided into local and global segments. 

Local SAP SHM segments can be used by all work processes of one application server instance (AS instance). Global SAP SHM segments can be used by all work processes of all AS instances running on the same host The size of the shared memory pools is defined in the parameter ipc/shm_psize_<xxx>. The parameter is valid on all operating systems. However, the creation of the pools is heavily dependent on the operating system.




Reference:

  1. help.sap.com 
  2. SAP Notes 
  3. Linkedin

Wednesday, 21 February 2024

SAP Memory Types in SAP Memory Management

 


SAP Memory Types in SAP Memory Management:

The below two main types of memory areas in SAP 

  1. Extended Memory (EM) 
  2. Heap Memory 
also go little deeper, then we have in total 6 memory areas 

  1. SAP Shared Memory (SHM) 
  2. Extended Segments Memory (ES) 
  3. Extended Memory (EM) 
  4. Global Extended Memory (EG) 
  5. PRIV Memory (HEAP) 
  6. PROC Memory 








Reference:
  1. help.sap.com 
  2. SAP Notes 
  3. Linkedin

SAP Memory Management

 



SAP Memory Management:
                        
                      While working on SAP ABAP systems, we often facing memory-related "DUMPS" error in "ST22" or some time see work processes go in "PRIV mode" when checked in t-code "SM50". We wondering why such things happen in running in the SAP system and how to handle it. To understand this, we first need to understand what "SAP memory" is and how "SAP Memory Management" is done. So let’s get start to know the basic concept of SAP Memory management.


What is SAP Memory:
                    
                SAP memory is a memory area to which all main sessions within an "SAP GUI" have access. You can use SAP memory either to pass data from one program to another within a session or to 
pass data from one session to another.

Workflow for SAP Memory:

               When a user logon to an application server instance (AS instance) in the ABAP system, a user session is opened. Within a session, the user sends a request to Application Server ABAP (ASABAP). An ABAP program is started that is executed by multiple work processes. A separate memory area is assigned to each user session. 

              To run an ABAP program within a user session (internal session), the work process allocates memory, which contains user data (user context), as well as program data. Depending on the type of data, it is located in different memory areas. SAP Memory Management decides when and in what order a work process allocates specific memory areas. The order of memory allocation depends on the work process type (dialog or non-dialog) and on the underlying operating system.

Types of SAP Memory 

On a very high level, there are mainly two types of memory areas in SAP 
  1.  Extended Memory (EM) 
  2.  Heap Memory 
If we go a little deeper, then we have in total 6 memory areas 
  1. SAP Shared Memory (SHM) 
  2. Extended Segments Memory (ES) 
  3. Extended Memory (EM) 
  4. Global Extended Memory (EG) 
  5. PRIV Memory (HEAP) 
  6. PROC Memory 

We will see upcoming post IN details about SAP Memory types.



Reference:
  1. help.sap.com 
  2. SAP Notes 
  3. Linkedin