Ansicht
Dokumentation

ABENMEMORY_CONSUMPTION_1 - MEMORY CONSUMPTION 1

ABENMEMORY_CONSUMPTION_1 - MEMORY CONSUMPTION 1

Fill RESBD Structure from EBP Component Structure   General Data in Customer Master  
This documentation is copyright by SAP AG.
SAP E-Book

Memory Requirement for Deep Data Objects

The memory requirement for a deep data object consists of constantly required memory for the reference and dynamically required memory for the header and the actual objects.

  • The memory requirement for the reference is 8 bytes. With data and object references, this is the memory requirement of the explicitly declared reference variable. In strings, internal tables, and boxed components, an implicit reference is created internally. For as long as no dynamic memory is requested, the memory requirement for a string, internal table, or boxed component is exactly 8 bytes.
  • The dynamic memory consists of a header (string header, table header, box header, or object header) and the actual data (string, table body, substructure, anonymous data object, or class instance). The reference refers to the header, which in turn contains the address of the actual data and additional administrative information. The following figure illustrates the memory usage of deep data objects.

IMAGE @@ABDOC_Deep_Memory.gif@@567@@245@@

Dynamic memory (header and data) is requested:

  • For dynamic data objects (strings and internal tables) by inserting content. For internal tables, the memory is requested in blocks, whereby the initial size of a block can be affected by the addition INITIAL SIZE when defining an internal table.

When a deep data object is initialized using CLEAR, REFRESH (obsolete), or FREE, the actual data is deleted, but the reference variables and the header of dynamic data objects are preserved. The latter is reused when another memory request is made. The memory requirement of a dynamic data object that was used once and then deleted therefore consists of the reference and the memory requirement of the header, except for boxed components. Only when using the statement FREE on internal tables, the table headers may also be deleted if they would take up too much memory. For static boxed components, initialization does not currently cause memory to be released. Initializing a static box in which initial value sharing was canceled does not delete the instance in the internal session but assigns its type-dependent initial value to it.

The memory requirement of the different headers is approximately as follows:

  • For performance reasons, the memory usage of a string header depends on the length of the string. Strings with a length of less than approximately 30 characters/ or 60 bytes are referred to as short strings. The memory overhead of the string header of short strings is between approximately 10 and 40 bytes, depending on the length of the string. For all other strings, the overhead is approximately 50 bytes, regardless of the string length.
  • A table header of an internal table that dynamic memory has already been requested for is approximately 100 bytes, regardless of the line usage. For filled internal tables, approximately 50 or 100 bytes are added for pointers, depending on whether the architecture is 32 or 64-bit.
  • A box header of a boxed component always uses approximately 20 to 30 bytes.
  • An object header always uses approximately 30 bytes.

In internal tables, there are additional line-related management costs in the header. This memory is not created in the table header but in parallel to the table body. This means that when lines are deleted, the corresponding administrative data is also deleted.

Notes

  • Deleting lines of internal tables using DELETE does not usually release any memory in the internal table, statements such as CLEAR or FREE must be used to free memory in internal tables.

Deep Data Objects, Memory Consumption






General Data in Customer Master   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 5918 Date: 20240424 Time: 121624     sap01-206 ( 97 ms )