SAP INITIAL MEMORY REQU GUIDL SAP Info
GUIDELINE 6.32 ( Version: 0011)
Initial Memory Requirements
ABAP_BACKGROUND
Internal tables are stored in the memory block by block. The ABAP
runtime environment allocates a suitable memory area for the data of the table by default. If the initial memory area is insufficient, further blocks are created using an internal duplication strategy until a threshold is reached. After this, all blocks are requested with a constant size between eight and 16 kilobytes.
The
rows when declaring an internal table, to override the number of initially allocated rows set by the system.
ABAP_RULE
Only use the
tables in nested tables if you can avoid using a large amount of memory unnecessarily.
ABAP_DETAILS
The
non-nested tables since the automatic memory location by the runtime environment leads to the required result. Automatic memory allocation only results in excessive memory consumption in nested inner tables if more memory is allocated for a number of inner tables than they actually use. If the number of entries in the inner tables is known from the o utset, the initial main memory requirement can be set accordingly using
Note
Instance attributes of classes that are declared as inner tables can
also be considered as nested tables. If many instances of a class with tabular attributes are expected, it can be useful to specify
Bad example
The following source text shows the declaration of a nested table, where
the initial memory requirement is specified incorrectly for the outer large table, not the inner small table.
WITH NON-UNIQUE KEY ...
TYPES: BEGIN OF line_structure,
...
int_table TYPE small_table,
...
END OF line_structure,
big_table TYPE SORTED TABLE OF line_structure
WITH UNIQUE KEY ...
INITIAL SIZE 10000.>
Good example
The following source text shows the declaration of a nested table, where
the initial memory requirement is specified according to the above rule: for the inner small table and not the outer large table.
WITH NON-UNIQUE KEY ...
INITIAL SIZE 4.
TYPES: BEGIN OF line_structure,
...
int_table TYPE small_table,
...
END OF line_structure,
big_table TYPE SORTED TABLE OF line_structure
WITH UNIQUE KEY ...>
Message text extract from SAP system. Copyright SAP SE.
Search for further information about these or an SAP related objects