System goes out of memory on establishing connection in a SAP-Delphi integrated project


When you are trying to release the object, make sure that you set the query object to null. When you set it to null, it will release the memory for sure. But the scope also plays a role, so make sure it is local to the procedure.

Example

   Please find a sample snippet for reference

    myFunction := TSAPFunctions.Create;
    myFunction.Connection := FConnection;
    myFunction.RemoveAll;
    myQuery := mySAPFunction.Add('interface here');
    myQuery.Call;
    myQuery := null; // will clear the memory

 

Hope this helps!

Updated on: 12-Dec-2019

80 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements