培训者:SAP成都研究院开发人员Jerry Wang

1. Understanding Memory Objects in ABAP

Note1: DATA itab WITH HEADER LINE for processing individual table rows have short forms that implicitly use the header line as work area. These short forms are allowed only outside of ABAP Objects.

/SF0A0001/ANONYMOUS

495142

2. Use Reference to Access Memory Object

ABAP里引用的用法

3. ABAP和很多其他语言一样,支持写时拷贝:

As internal tables and strings can become very large, the copy operation may be quite time-consuming. On the other hand, the copy operation is only necessary if a modification is made via one of the references, which is NOT always the case.

For this reason, ABAP runtime delays the copy operation until a modification is actually made. These object types (internal tables and strings) keep track of the number of references that point to them, which is referred to as “reference counting.”

4. 写时拷贝的工作原理

5. ABAP的内存管理之内存清理

内存释放关键字CLEAR,REFRESH和FREE的区别:

6. ABAP引用类型的内存分配

7. ABAP字符串(String)类型的内存分配

8. ABAP内存垃圾回收器的工作原理

9. ABAP内存垃圾回收的实现算法

10. ABAP垃圾回收机制的触发时机

11. ABAP垃圾回收的手动触发,请谨慎使用

12. 更多关于引用类型的变量在ABAP垃圾回收算法中的影响

13. ABAP bound memory的含义

the sum of the size of the memory object and the bound memory of all DIRECT children that are table bodies or strings with a reference count of one.

Upon deleting the memory object, the bound memory is the minimum amount of memory that is released, and the referenced memory is the maximum amount that can be released. Therefore, the amount of memory that is actually released is somewhere between these two values.

14. ABAP内存预分配算法(preallocation mechanism)介绍

15. ABAP已分配内存和已使用内存的区别

For internal tables and strings, ABAP runtime environment uses a preallocation mechanism that automatically reserves some EXTRA storage when the memory object is created to allow for potential growth.

It avoids many allocation and deallocation operations. Otherwise, ABAP runtime environment would have to allocate new storage every time the memory object grows.

Due to this preallocation mechanism, both internal tables and strings also have “allocated memory” and “used memory” values as memory sizes.

Allocated memory is the amount of memory that is set aside for the memory object. Used memory is the current size of the memory object used by the application.

For class objects and anonymous data objects, used memory and allocated memory are the same. Because their size is fixed, they don’t require additional space to accommodate growth.

16. ABAP程序内存消耗的尺寸计算介绍

17. 什么是ABAP内存分配中的SCC - strongly connected component - 强连通组件

18. 有用的ABAP内存分析和调优工具,事务码S_MEMORY_INSPECTOR

19. 具体例子,您知道下面这段代码,新生成的引用类型的变量,内存是从哪里分配的?堆?不完全对。

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.

For every user session , a main session ( external session ) can be opened. Each main session is assigned its own memory area of ABAP memory ( EXPORT — IMPORT ) rdisp/max_alt_modes

Each call of an ABAP program creates a new internal session, in which the called program is loaded.

20. 什么是ABAP程序的PXA - Program Execution Area

21. ABAP程序的用户上下文 - User Context

22. 什么是ABAP的工作进程

23. ABAP工作进程的内存虚拟地址空间和物理地址空间的映射

Roll Area:

Memory area with a set (configurable) size that belongs to a work process.

For technical reasons, the roll area is always the first memory available to use for a work process. Only afterwards can extended memory be requested.

When the context of a work process changes, the data is copied from the roll area to a common resource known as the roll file. To prevent repeated copying, another roll buffer is located in between, which is part of the shared memory

Paging area:

Allocation of memory for the current internal session by transferring pages out of memory, similarly to operating system paging. SAP’s memory management concept currently limits SAP Paging to cases where the ABAP commands EXTRACT and EXPORT… TO MEMORY… are used.

Private memory:

If the extended memory is fully occupied, or the limit for the work process has been exceeded, private memory is assigned to the work process. This is known as private memory because it is specific to the process, and the user context can no longer be processed by a different work process (PRIV mode).

ABAP扩展内存 - extended memory

User context is stored in the extended memory (EM) to enable fast context change . Depending on the operating system, how SAP implements EM addressing/mapping is different.

When the context is changed, the user context is not copied as with the roll area. Instead it is allocated to alternating work processes by mapping operations which results in a faster context change because less data is copied and mapping an extended area is not work-intensive. The result is low CPU usage and shorter access times.

SAP dispatcher is responsible for the following principle tasks:

1. Initialization, reading profile parameters, starting work processes and logging on to the message server

2. Evenly distributing the transaction load across work processes

3. Connecting to the GUI layer

4. Organizing communication processes

这道题的答案:

The roll area consists of two segments. The first segment, which can be set with the parameter ztta/roll_first, is assigned to the work process first as memory. If this is used up, the work process has more memory assigned to it. The amount of memory is determined by the difference between the ztta/roll_area and ztta/roll_first parameters.

正确答案,不能一概而论,有三种情况。

情况1:

Roll area: if ( roll_current_area + request size <= roll_area )

情况2:

Extended memory: if ( roll_current_area + request size > roll_area ) AND ( extend memory is not full )

情况3:

Private memory: if ( roll_current_area + request size > roll_area ) AND ( extend memory is full )

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

SAP专家培训之Netweaver ABAP内存管理和内存调优实践相关推荐

  1. python的内存管理机制及调优手段(很详细的哦)

    内存管理机制:引用计数.垃圾回收.内存池 引用计数 引用计数是一种非常高效的内存管理手段, 当一个Python对象被引 用时其引用计数增加1, 当其不再被一个变量引用时则计数减1. 当引用计数等于0时 ...

  2. python的内存管理机制及调优手段_Python的内存管理机制及调优手段

    内存管理机制:引用计数.垃圾回收.内存池 引用计数: 引用计数是一种非常高效的内存管理手段,当一个Python对象引用时其引用计数加一,当其不再被一个变量引用时则减一.当引用计数等于0时对象被删除. ...

  3. python的内存管理机制及调优手段_Python的内存管理机制及调优手段?

    转载自 http://kkpattern.github.io/2015/06/20/python-memory-optimization-zh.html 准备工作 为了方便解释Python的内存管理机 ...

  4. Linux 的内存管理工具和调优参数

    1. free 2. top 3. vmstat 4. slabtop; 5. pmap 6. dmesg 7. /proc/meminfo 8. /proc/sys/vm 目录下的文件 9. syn ...

  5. SAP ABAP 开发管理 代码内存标记 位置使用清单(Mark of memory id)

    SAP ABAP 开发管理 代码内存标记 位置使用清单(Mark of memory id) 引言: 代码内存标记(Mark of memory id)是我开发中对 ABAP MEMORY ID 使用 ...

  6. 【Linux 内核 内存管理】内存管理架构 ④ ( 内存分配系统调用过程 | 用户层 malloc free | 系统调用层 brk mmap | 内核层 kmalloc | 内存管理流程 )

    文章目录 一.内存分配系统调用过程 ( 用户层 | 系统调用 | 内核层 ) 二.内存管理流程 一.内存分配系统调用过程 ( 用户层 | 系统调用 | 内核层 ) " 堆内存 " ...

  7. Linux内存管理之内存管理单元(MMU)(二)

    Linux内存管理之内存管理单元(二) 1.1.什么是MMU 在CPU内部,有一个专门的硬件单元来负责这个虚拟页面到物理页面的转换,它被被称为内存管理单元(Memory Management Unit ...

  8. Linux内存管理:内存寻址之分段机制与分页机制

    目录 Linux 内存寻址之分段机制 前言 分段到底是怎么回事? 实模式的诞生(16位处理器及寻址) 保护模式的诞生(32位处理器及寻址) IA32的内存寻址机制 寻址硬件 IA32的三种地址 MMU ...

  9. Linux内存管理:内存分配:slab分配器

    <linux内核之slob.slab.slub> <Linux内核:kmalloc()和SLOB.SLAB.SLUB内存分配器> <Linux内存管理:内存分配:slab ...

最新文章

  1. Java报错解决:org.apache.http.ConnectionClosedException: Premature end of chunk coded message body: closi
  2. 测试ESP32S基本模块的功能,并验证是否可以应用在AI智能车竞赛检测激光信号中
  3. 查看MySQL句柄_mysql查询语句-handler
  4. PHP框架有没有前途?是否适用于复杂的web开发框架
  5. 腾讯的一道链表笔试题【总结】
  6. 区块链优秀github开源项目
  7. python基本函数归整
  8. 传递一个父id返回所有子id的用法,可用于删除父级以下的所有子级
  9. poj2828 Buy Tickets
  10. android gesture,Android Gesture 手势创建以及使用示例
  11. eviews建立时间序列模型_模型建立——时间序列 eviews协整检验(EG两步法(Engle-Granger))...
  12. 维纶触摸屏程序实际项目,威纶通界面UI
  13. 微信开通检测 检测号码是否开通微信
  14. 股票大作手回忆录(读书笔记)
  15. typedef——用法总结
  16. 暗恋一个人是一种什么体验?
  17. Android——RIL 机制源码分析
  18. Chakra-UI——React UI 框架
  19. 0基础学挨踢-国产达梦数据库dmPython安装和避坑(Windows/Linux,离线状态)
  20. STC单片机实现智能小车避障功能的C语言例程

热门文章

  1. [原创] 盟军敢死队2 - 3D模型/动作浏览器
  2. Java GC原理简单讲解
  3. 朴素贝叶斯相关基础知识
  4. 《终身成长》读书笔记(part2)--失败从一种行为,转变为一种身份
  5. python基础(part8)--容器类型之元组和字典
  6. 巧做辅助线计算三角形角的度数
  7. mySPA set delivery mode 之后,Chrome network 里观察不到cart 请求了
  8. 从一个 SAP CRM 软件实际的故障处理出发,谈谈企业管理软件领域内那些很难稳定重现故障的处理技巧
  9. Angular应用页面里appId的生成逻辑和位置
  10. 2020年10月21日 星期三 工作日志