`
JerryWang_SAP
  • 浏览: 1025446 次
  • 性别: Icon_minigender_1
  • 来自: 成都
文章分类
社区版块
存档分类
最新评论

SAP专家培训之Netweaver ABAP内存管理和内存调优最佳实践

阅读更多

培训者: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的原创文章,请关注公众号"汪子熙":

 
0
0
分享到:
评论

相关推荐

    SAP-ABAP语法详解教材

    《SAP-ABAP语法详解教材》是一本深入解析SAP ABAP编程语言的专业教程,专为初学者和有经验的开发者设计。SAP ABAP(Advanced Business Application Programming)是SAP系统中用于开发业务应用的主要编程语言。通过...

    Best Practice Guide Migration of SAP ABAP to SAP HANA

    文档提供的是一般性专家知识和最佳实践信息,尤其适用于通过使用传统迁移工具(如软件供应管理器1.0和R3load)进行的SAP HANA的经典异质系统拷贝。 2. **迁移前的考虑因素**: 在进行迁移前,企业需要了解迁移SAP...

    苏宁 SAP Basis 系统管理培训

    本次“苏宁 SAP Basis 系统管理培训”旨在提升相关人员对SAP Basis的理解和操作技能,以优化苏宁的信息化管理。 首先,我们需要理解SAP Basis的基本概念。SAP Basis是SAP软件的基础平台,它包括操作系统、数据库、...

    sap basis培训资料

    SAP BASIS是SAP系统中的一个关键组成部分,主要负责管理和维护SAP系统的基础设施,包括操作系统、数据库、中间件以及...通过系统的培训,学员能够全面掌握SAP BASIS的各项技术和实践,为企业的SAP系统提供坚实的后盾。

    SAP Performance Optimization Guide

    SAP内存配置分析是性能优化的关键环节,它涉及到分析SAP缓冲区、SAP扩展内存、SAP堆内存和SAP回滚内存。此外,还有内存分配情况的展示和其他监控功能。 SAP性能优化指南还提供了关于ABAP和Java程序性能问题的诊断...

    SAP ADM122

    - **性能调优**:教授如何优化 SAP NetWeaver AS 的性能,包括内存管理、CPU 使用率等方面。 - **日志与审计**:解释如何使用日志记录和审计功能来追踪系统的操作历史。 ##### 3.4 安全性与备份恢复 - **安全性...

    SAP ADM101

    - **SAP NetWeaver Application Server for ABAP (AS ABAP)**:专为ABAP语言设计,用于开发和运行基于ABAP的应用程序。 - **SAP NetWeaver Gateway**:提供了一个统一的数据和服务访问层,使外部系统能够轻松地与...

    SAP_System_Administration_Made_Easy_4.6

    4. **性能监控与优化**:学习使用SAP Monitoring工具(如ST05、ST06)来检查和优化系统性能,包括SQL语句分析、内存管理、CPU使用率等。 5. **数据库管理**:理解不同类型的数据库(如Oracle、HANA)对SAP系统的...

    sap wda实例与讲解

    5. **部署与测试**: 部署应用到SAP服务器,并进行功能测试和性能调优。 四、WDA的优势 1. **快速开发**: WDA提供了丰富的预定义控件和模板,大大减少了开发时间。 2. **增强用户体验**: 支持多种设备,提供流畅的...

    SAP basis手书

    总的来说,SAP Basis手书是一本全面的指南,它不仅涉及了ABAP和J2EE的核心技术,还提供了系统管理、安全、性能优化等多方面的知识,是学习和实践SAP Basis管理和技术的宝贵资源。对于那些希望在SAP领域深入发展的...

    JA100 sap j2se

    在SAP系统中,Java技术的应用主要集中在SAP NetWeaver平台之上,它为SAP和其他非SAP应用程序提供了集成环境。JA100 sap j2se指的是SAP环境中Java开发的一个概览性培训课程或文档资料,主要针对的是SAP NetWeaver ...

    SAP BASIS手册

    SAP BASIS(Business Add-In System)是SAP系统的核心技术之一,它为SAP应用提供了一个统一的基础架构和技术平台。SAP BASIS管理员负责确保SAP系统的高效稳定运行,涉及系统安装、配置、监控、备份恢复、性能调优等...

    Apress - Enterprise Java for SAP

    这本书深入探讨了Java技术在SAP系统集成、扩展和应用开发中的关键角色,旨在帮助读者理解和掌握在SAP平台上的Java实践。 首先,书中可能会介绍Java与SAP的关系。SAP作为一个全球领先的企业软件解决方案提供商,其...

    Managing_SAP_and_PATROL4.pdf

    根据提供的文档片段,我们可以总结和提炼出与SAP管理和PATROL相关的多个关键知识点。下面将对这些知识点进行详细的阐述。 ### SAP管理 #### 1. 概述 SAP(System, Applications, and Products in Data Processing...

    SAP Database Administration with Oracle - 2008.part2

    这本书由Michael Hoding、Andre Faustmann、Gunnar Klein和Ronny Zimmermann四位专家合著,旨在帮助读者深入理解如何在Oracle数据库环境中有效地管理和优化SAP系统。 在SAP与Oracle的结合中,数据库管理员需要掌握...

    ADM100_EN_Col71_FV_Part_Ltr.pdf

    **SAP ADM100**,即“Administration AS ABAP I”,是SAP官方提供的一门关于SAP NetWeaver Application Server - ABAP(简称AS ABAP)的管理与维护课程。本课程版本为71,发布于2011年,版权归属于SAP AG。 #### 二...

    SAP课程介绍.doc

    - **主要内容**:本部分主要介绍了SAP NetWeaver的管理层面的知识,包括系统管理和配置、性能监控与调优等。 - **重要性**:作为SAP的核心平台之一,NetWeaver为SAP应用提供了基础架构支持。了解其管理机制对于确保...

    saprfc-1.4.1.All.zip

    【标题】"saprfc-1.4.1.All.zip" 指的是一个特定版本的 SAP RFC(Remote Function Call)库的压缩包文件,版本号为 1.4.1,包含了所有适用平台的构建。...同时,确保遵循最佳实践,以保证系统的稳定性和安全性。

Global site tag (gtag.js) - Google Analytics