Skip to Content

free the memory of object

hi friends

how can i free the memory of a object ex

( cl_dd_link_element ), the class cl_dd_link_element is not has a destructor

i freed the references of that object but the object is still occupying the memory through out the programm

i want to free the memory of that object in the middle of the programme itself.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 13, 2005 at 08:00 AM

    Hi Shiva,

    If the object does not have a destructor, there's nothing that you can do about it. You have said that you have freed the references to that object. that is all you can do about it.

    Garbage collection is automatic in ABAP. You cannot control it explicitly. If the object is occupying memory, then so long as it doesn't affect the program adversely, there's no harm.

    Regards,

    Anand Mandalika.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Just another point that I can think of. If you are using a global object, is it possible for you to define the object reference as well as create the object inside a <i>subroutine</i> ? That is certainly a much surer way of ensuring the garbage collector gets to work as soon as possible.

      Regards,

      Anand Mandalika.

  • Posted on May 13, 2005 at 07:59 AM

    Hi,

    U can try this out

    IF NOT ( lobject IS INITIAL ).

    CALL METHOD lobject->free

    EXCEPTIONS

    cntl_error = 1

    cntl_system_error = 2

    OTHERS = 3.

    CLEAR: lobject.

    PERFORM f9006_error_handle USING ptext.

    ENDIF.

    FORM f9006_error_handle USING value(ptext).

    IF sy-subrc NE 0.

    CALL FUNCTION 'POPUP_TO_INFORM'

    EXPORTING

    titel = text-e03

    txt2 = sy-subrc

    txt1 = ptext.

    ENDIF.

    ENDFORM. " f9006_error_handle

    Thanks & Regards,

    Judith.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 13, 2005 at 01:38 PM

    Have a look on the ABAP statement FREE...

    Add a comment
    10|10000 characters needed characters exceeded

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.