SAP MEMORY USAGE ABEXA

Get Example source ABAP code based on a different SAP table
  


ARTIClE

Deep Data Objects, Memory Consumption
The example illustrates the management costs of deep components with low data content.

ABAP_SOURCE_CODE
ABAP_EXEC

ABAP_DESCRIPTION
At the breakpoints, you can use the ABAP Debugger to display the memory requirements of the four internal tables itab, rtab, ttab, and otab.
At the first breakpoint, the four tables have the same dynamic yet not duplicative data content, that is, 1000 different integers. Whereas for itab, the data content size of about 4 MB is only increased by the management costs for itab itself amounting to around 100 bytes, all other tables create management costs for each single table row. For the deep row types in rtab, ttab, and otab, the data content size of 4 MB is confronted with management costs in the order of 100, 200 and 300 MB. The costs for the inner internal table in ttab are higher than that for the data reference in rtab. The management costs for otab are made up of the costs for the object references and for the internal tables in the object references.
At the second breakpoint, all rows of each of the four tables were initialized using FREE. Of course, this does not effect the memory requirements of itab. In rtab, all data as well as all management information of the individual reference variables was deleted, leaving memory requirements of about 8 MB for the initial references plus the management costs for rtab itself. In ttab, all data was deleted but the individual table headers were retained. Although the management costs could be reduced slightly this way, this still leaves about 100 MB of pure management costs. For otab, by contrast, the situation was similar to rtab, leaving only the costs for the initial references.
This example shows on the one hand that for internal tables with deep row types the management costs may easily exceed the data content and on the other hand that after deleting data a table with object references is less expensive than a table with inner tables.