终端内存模型

来源:互联网 发布:c语言冒泡排序比较方法 编辑:程序博客网 时间:2024/05/23 19:32

理解下这玩意儿,对写程序帮助还是挺大的,而且在看其他abap涉及内存的文章时,也容易理解一些,比如模块池的初始化 load-of-program 其实就是放到inner session中的.

先来个图:


不同级别的内存,分别对应各自的会话层次:

1)首先是Shared Memory: 这个通常存放代码,数据表等全局的系统的数据信息

2)SAP Memory:这个是某个用户所有操作所共享的空间,例如用户的配置信息,SPA/GPA等应该就是放这里的

   但有个注意点,据说sap memory中不能放对象,具体原因不知,也没试过,人家建议用DB或File System来处理

3)ABAP Memory:简单的理解就是用户运行的程序某个’程序’所占用的空间,不同的’程序’是相互独立的

  这里的’程序’要理解为sap gui中打开的一个tab,  这个tab中运行的内容都作为一个程序看待

  事实上这个’程序’实际运行时可能涉及代码上的多个程序代码 ,  例如在程序A中 call transaction B 这时涉及 AB两个程序的代码

4)Inner Session:有了3)中的解释,这里就是对应的上面提到的A 和 B各自的内存空间

所以A,B两个程序代码中的变量是各自独立的,属于各自的内部内存空间

因此export 和 import的操作就可以理解了,这是将数据放到Abap Memory中 方便各个Inner Session中的程序共享

 

关于具体的各个内存的解释,参考以下文档,就明白为啥用户打开的标签数是限制是6个,屏幕序列最多call 9 个,

SPA/GPA 和 export import操作的差异等等…

User Session

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”.

Main Session

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.

Internal Session

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.

Note

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.

原创粉丝点击