Releasing Memory for Large Internal Table


Generally CLEAR or REFRESH statement is used to release the allocated memory for internal tables. Now think of a situation where an internal table initially contains a huge volume of records so as the huge allocated memory. Now you deleted [ DELETE statement doesn’t release memory as CLEAR or REFRESH statement does ]  most of the records from the internal table as per needed but what about the large allocated memory to the table.

In such a case below process can be used for efficient use of memory.


 

Lets execute the below report with break point set up to analyse the memory.

1

Execute the select statement and in the debugger select the ‘Memory Analysis’ tab and put LT1 and LT2. Observe the allocated memory for LT1 table.

2

Now execute the delete statement which deletes most of the records form table LT1. Now still the allocated memory for the table is not decreased.

3

Now execute the APPEND LINES OF LT1 TO LT1. statement. And observe the allocated memory for the table LT2 which is much more less than the allocated memory of the table LT1.

4

Now we can refresh the table  LT1 and assign back the records of LT2 to LT1 and continue.

5

6

7


 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s