终端内存模型
理解下這玩意兒,對(duì)寫程序幫助還是挺大的,而且在看其他abap涉及內(nèi)存的文章時(shí),也容易理解一些,比如模塊池的初始化 load-of-program 其實(shí)就是放到inner session中的.
先來(lái)個(gè)圖:
不同級(jí)別的內(nèi)存,分別對(duì)應(yīng)各自的會(huì)話層次:
1)首先是Shared Memory: 這個(gè)通常存放代碼,數(shù)據(jù)表等全局的系統(tǒng)的數(shù)據(jù)信息
2)SAP Memory:這個(gè)是某個(gè)用戶所有操作所共享的空間,例如用戶的配置信息,SPA/GPA等應(yīng)該就是放這里的
?? 但有個(gè)注意點(diǎn),據(jù)說(shuō)sap memory中不能放對(duì)象,具體原因不知,也沒試過(guò),人家建議用DB或File System來(lái)處理
3)ABAP Memory:簡(jiǎn)單的理解就是用戶運(yùn)行的程序某個(gè)’程序’所占用的空間,不同的’程序’是相互獨(dú)立的
? 這里的’程序’要理解為sap gui中打開的一個(gè)tab,? 這個(gè)tab中運(yùn)行的內(nèi)容都作為一個(gè)程序看待
? 事實(shí)上這個(gè)’程序’實(shí)際運(yùn)行時(shí)可能涉及代碼上的多個(gè)程序代碼 ,? 例如在程序A中 call transaction B 這時(shí)涉及 AB兩個(gè)程序的代碼
4)Inner Session:有了3)中的解釋,這里就是對(duì)應(yīng)的上面提到的A 和 B各自的內(nèi)存空間
所以A,B兩個(gè)程序代碼中的變量是各自獨(dú)立的,屬于各自的內(nèi)部?jī)?nèi)存空間
因此export 和 import的操作就可以理解了,這是將數(shù)據(jù)放到Abap Memory中 方便各個(gè)Inner Session中的程序共享
?
關(guān)于具體的各個(gè)內(nèi)存的解釋,參考以下文檔,就明白為啥用戶打開的標(biāo)簽數(shù)是限制是6個(gè),屏幕序列最多call 9 個(gè),
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.
總結(jié)
- 上一篇: 标准程序的Parameter id 并不
- 下一篇: Access导入MDB文件