Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Unable to free memory - ABAP!!

Hello all,

I am new to OO programming,

I use the following classes in my program.

  qstree               TYPE REF TO  cl_qstree_ckml         
lcl_node             TYPE REF TO  cl_qsnode_material_ckml
lcl_node1            TYPE REF TO  cl_qsnode              
lcl_node2            TYPE REF TO  cl_qsnode  

After i execute these class methods in a loop, a lot of deep structures are created which occupies a lot of memory.

To free and release the memory i tried using.

CLEAR: qstree, lcl_node, lcl_node1, lcl_node2.

   FREE : qstree, lcl_node, lcl_node1, lcl_node2.

.

Also i tried using destructor of class using ->FREE. But none of these seems to release the occupied memory.

I even tried calling the abap garbage collector explicitly. Even that didn't help.

After executing all these, if i check memory analysis it still shows:

I have not created any of these tables and instances explicitly and it occupies a lot of memory.  How can I clear all these data and free up the memory. There are more than 1000 such structures and tables created by the class.

Dyn. Memory Object (Used) is memory analyzer is also very high, 200 mb+.

Another thing I noticed is , In windows task manager, My sap gui occupies more than 500mb of main memory when this program is run. Even exiting the external session doesn't seen to release the memory. It is not released unless i log off. I can view the same memory usage in SM04 also.

I am still a beginner to OO abap, Kindly Help,

Regards, RR

Former Member
Not what you were looking for? View more on this topic or Ask a question