OleObject Memory Leak Bug?

Hello,

I have a very big problem with Xojo. I use QuickOPC to use the OPC-DA/UA protocol. For a long time I was looking for the error why the programs hang after 2 days of running as soon as xojo uses the entire 64 GB of RAM. Now I have found the error. The memory that Xojo reserves for the OLE objects is no longer released and the RAM becomes full. What I found out is that it is not the QuickOPC Lib because I can use it in another programming language (Purebasic) without any problems and the memory is freed up again. I read in the forum itself that these problems with OLE have been discussed more often over the years and no solution has yet been found. Unfortunately I have to find a solution here at short notice, otherwise I would have to do the work and port the program to Purebasic.

Or am I just making a beginner’s mistake? When I use this code in a timer, the RAM fills up.

for i as integer = 1 to 10000
 Dim Client As New OleObject  ("OpcLabs.EasyOpc.UA.EasyUAClient")
 Client = nil
next

I would be grateful for any tip.

If that OLE object is reusable, can you try just creating a single instance of it, and reusing it, e.g.

Dim Client As New OleObject  ("OpcLabs.EasyOpc.UA.EasyUAClient")
for i as integer = 1 to 10000
  var result as variant = client.value("foobar")
next

If that ole object is not reusable, then I think you have to get Xojo to fix the leak.

1 Like

Open a private issue report, include a Purebasic sample, libs, etc proving that the issue is not the lib and detailed explanations. Open another issue report, public, short explanations, points to this forum thread, also add the link of the private report. We won’t be able to interact with the private one, but I think that we will get notified that it was closed (hope fixed).

Thanks for the quick responses.
I discovered that the error was already reported and confirmed 3 years ago.
https://tracker.xojo.com/xojoinc/xojo/-/issues/62873
What option is there for me other than waiting?

Thanks again for your support.

1 Like