Skip to Content
author's profile photo Former Member
Former Member

FREE MEMORY

Hi guys. Does anyone know why I can not use, or is not recomended to not use "free memory" command without the "ID" ? Do you have any example of why can I not simple use "Free memory" ?. I have a large program (large indeed...)that creates several internal tables, nore of them liberates memory after it finishes and when the user executes several options of the program and gets back and executes again, (WITHOUT leaving the transaction), then by transaction SM04 you can see how the memory gets bigger. I started using "free..internal table" (when I see that an internal table with data will not be used any more along the program) then the memory gets smaller after each execution, but not smaller enough for the Basis team. So instead of using free "internal table" for each table used in the program (it has too much ...internal talbes ) then I wanted to use just FREE MEMORY at the end of the program, instead of FREE MEMORY ID id. Does anyone have a practical example of why is not recomended to use only FREE MEMORY. Somewhere I saw the following: " You should refrain from using FREE MEMORY without the addition ID, since in this case all clusters are involved"- The question is: I do not understand the impact of all clusters being involved. Do you have an explanation about the impact ?

Edited by: Eduardo Giribaldi on Jan 5, 2008 1:21 PM

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jan 05, 2008 at 12:38 PM

    Eduardo,

    FREE MEMORY only makes sense when you do

    EXPORT fld TO db ....
    
    IMPORT fld FROM db....
    

    otherwise not. If you are coding in ABAP OO you can clear your pointer or reference for e.g.

    Data: g_ref TYPE REF to CL_ABAP_CHAR_UTILITIES.
    
    []............
    
    []............
    
    CLEAR g_ref.    "<--------------
    

    At this point the Garbage Collector is called automatically by the ABAP runtime system. If you are using procedural code, you can use statements like:

    CLEAR v_var1.
    FREE itab.
    * etc.
    

    at the end of your data processing.

    Hope this gives you a lead.

    Cheers,

    Sougata.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Sougata Chatterjee

      ok man. you answered my question about the impact involved by deleting all clusters. yes, the program uses several exports and imports in different points for particular data it handles and I can cont loose those...Thanks.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.