This section describes the memory organization from the perspective of an ABAP program, or which memory can be accessed by an ABAP program. For a more general and technically more detailed description, see the SAP Memory Management documentation.
The following diagram shows the general memory organization of ABAP programs up to the level of the internal session:
The application layer of an ABAP-based SAP system can be distributed across several application servers. If an ABAP system has more than one application server, these are normally installed on different computers. It is also possible, however, for several application servers of one or more ABAP systems to be installed on the same host computer.
Every application server has access to the central database of the SAP system. Each application server has its own shared memory. The ABAP runtime environment uses the shared memory for programs, program data, and buffers (for example, in SAP buffering). ABAP programs can store shared objects and data clusters in the shared memory.
The shared memory is frequently used and may therefore become a sparse resource, which can result in bottlenecks when explicitly storing data from ABAP programs.
Logging on to an application server opens a user session. A user session is assigned its own memory area of the SAP memory, in which SPA/GPA parameters can be stored. An additional user session can be opened by the program using a Remote Function Call with the destination "NONE".
For every user session, a main session is opened. Each main session is assigned its own memory area of ABAP memory, in which data clusters can be stored.
Additional main sessions for a user session can be opened using a Remote Function Call with the addition STARTING NEW TASK, or by entering a transaction code after "/o" in the input field of the toolbar. As of release 7.0, 16 main sessions are permitted for each user session. Before release 7.0, the maximum number was 6. The actual possible number for a particular system is defined using the system parameter rdisp/max_alt_modes, which has a default value of 6.
Each call of an ABAP program creates a new internal session, in which the called program is loaded.
The memory area of an internal session is divided into a roll area and a PXA. This contains the objects of a program. Technically, roll areas and the PXA are stored in the shared memory of the application server, where they are administrated by SAP Memory Management .
In one main session, there can be a maximum of nine internal sessions, which always belong to a call sequence. Data from the ABAP memory is always assigned to a call sequence.
On 64-bit platforms, an internal session can theoretically require up to 4 TB of memory. On 32-bit platforms, the theoretical upper limit is 4 GB. The practical upper limit is usually below the theoretical limit, since the actually physically installed main memory is the maximum available and it is divided up amongst all users.
Instances of classes, with the exception of shared objects, are located in the internal session. It is therefore not possible to store references to the ABAP memory.