Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between Free and Refresh

Former Member
0 Kudos

Hi,

I know that Refresh or clear deletes the content of an internal table but memory allocation remains.So we can use that same internal table in another purpose.

Whereas I studied that Free deallocates the memory and the internal table cannot be used after we freed the internal table using Free:Itab. But I used the internal table(filled the internal table with data) after the free syntax. It doesn't show any error or dump.

Can anyone please explain what's the difference between Free,Refresh,clear?

Regards,

Arjun

1 ACCEPTED SOLUTION

matt
Active Contributor

arjun mohan wrote:

Whereas I studied that Free deallocates the memory and the internal table cannot be used after we freed the internal table using Free:Itab.

I don't know where you read this, but it's incorrect. You can use an internal table after FREE.

To all intents and purposes, except for tables with header lines, which I hope no-one uses too much any more, CLEAR, FREE and REFRESH do the same thing. I've never had to worry about it, and I write memory intensive programs.

5 REPLIES 5

Former Member
0 Kudos

Hi arjun ,

Question is bit funny , system re allocate the memory again when it found any command related to internal table even after free statement is used already.

Regards,

Venkat.

Former Member
0 Kudos

Hi Arjun,

i hope this way you can understand better..

before clear statement:-

   

After clear: -

after Free:-

again allocate :-

With regards

Vikas

0 Kudos

Hi Vikas,

Thanks for your answer.I understood from above suggestion is that with clear table body memory is released .With free initial memory requirement for the table will also be released.

But I want to know How (Memory Allocated )312 becomes 160 after free statement?And how this memory allocated is calculated and memory actually used is calcuated?

Can u please explain in detailed manner?

Regards,

Bharadwaj

0 Kudos

Hi Vikas,

Thanks for your answer.I understood from above suggestion is that with clear table body memory is released .With free initial memory requirement for the table will also be released.

But I want to know How (Memory Allocated )312 becomes 160 after free statement?And how this memory allocated is calculated and memory actually used is calcuated?

Can u please explain in detailed manner?

Regards,

Arjun

matt
Active Contributor

arjun mohan wrote:

Whereas I studied that Free deallocates the memory and the internal table cannot be used after we freed the internal table using Free:Itab.

I don't know where you read this, but it's incorrect. You can use an internal table after FREE.

To all intents and purposes, except for tables with header lines, which I hope no-one uses too much any more, CLEAR, FREE and REFRESH do the same thing. I've never had to worry about it, and I write memory intensive programs.