2

I am using below query which has handle but I can see nothing happens even if I delete/not delete the object of the handle. But everyone says always delete the object finally. Why we need to delete them? what happens if we don't delete them? How do we see that ?

finally:
  if valid-handle(hQueryTest)   then delete object hQueryTest no-error.
  if valid-handle(hQuerytestvalue) then delete object hQuerytestvalue no-error.
end finally.
Bharat
  • 177
  • 7

1 Answers1

6

OpenEdge simply does not have a reference count based garbage collector for handle based objects. So the object the query handle points to will remain in memory of the AVM forever. If that's on an AppServer, the memory consumption of the AppServer process may grow slightly but steadily.

OpenEdge has the concept of WIDGET-POOLs that can support with memory management.

You can check the DynObjects.* Log-entry-type to get insights into the Life-Time of dynamic objects, handle-based or class-based.

Tim Kuehn
  • 3,201
  • 1
  • 17
  • 23
Mike Fechner
  • 6,627
  • 15
  • 17
  • 1
    Take a loog at the doc at https://docs.progress.com/bundle/openedge-abl-troubleshoot-applications/page/Logging-in-OpenEdge.html – nwahmaet Apr 04 '22 at 19:23
  • 1
    These memory leaks may be relatively minor for the cases you have asked about, but if you have temp-table handles or memptrs, the leaks may be major. – nwahmaet Apr 04 '22 at 19:24
  • 1
    While it may seem silly, 1 million query handles just took 44 seconds to create and managed to consume 21 GB of RAM. The procedure editor is having quite a hard time cleaning that mess up. Reduce that to 100K query handles, 8 seconds to create, 5 seconds to clean, 2.5 GB RAM. When you clean as you go: 0.1 seconds, no additional RAM. – Stefan Drissen Apr 05 '22 at 11:24