cancel
Showing results for 
Search instead for 
Did you mean: 

How does the (ABAP) AS handle unused internal tables? (garbage collection?)

Former Member
0 Kudos

Hi,

Let's suppose i have a class, which contains a simple method like follow:

method do_this.

data lt_table type something_tab.

"do some manipulation on the lt_table.

endmethod.

So during runtime, at the moment when we leave the method "do_this", will the lt_table memory space be freed? Or is it still allocated? Do we need to use an explicit "free lt_table" statement?

I want to optimise memory usage in my code, and was wondering if such explicit calls to "free" is necessary.

Thank you,

Edited by: Huynh Van Du Tran on Mar 16, 2009 6:38 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

vimal_kumar4
Explorer
0 Kudos

Hi,

I would say it would be better use FREE itab at the end of the processing in your code. In the end-of-selection in your code, you can FREE all your itabs that were used in the program. This is one of the good approach of optimizing the memory.

Regards

Vimal

Former Member
0 Kudos

Hello ,

Since lt_table is a local variable in the method . you need not to free it explicitly.

Regards

Vivek