cancel
Showing results for 
Search instead for 
Did you mean: 

An ABAP question about memory leak and object instances

TMNielsen
Contributor
0 Kudos
272

Hi

I trying to use SAP ADBC to connect to an external database. So I read documentation and see some warnings about the risk of memory leak. 
Usually when I write ABAP programs I more or less rely on the standard garbage collection that frees memory when a program is exit'et.

However if I have a program that is not really exiting for a longer period and the user can repeatedly call a method that creates object instances I guess it would be a good idea to free this instances when they are no longer in use.

The ADBC documentation contains some programming examples and they contains code I doesn't know how works memory wise.

 

 

NEW cl_sql_statement( con_ref = con_ref )->execute_ddl( create_string ).

 

As I understands this compact syntax an object instance of cl_sql_statement is created and the method execute_dll is executed.

But when is the instance of cl_sql_statement freed again. The instance doesn't have a name, so I have no handle I can use in a free command.

Accepted Solutions (0)

Answers (0)