Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Memory leaks TEasyUAClient

More
03 Nov 2016 08:55 - 03 Nov 2016 08:55 #4534 by support
Replied by support on topic Memory leaks TEasyUAClient
Interesting. A bit of Googling gives some interesting results, e.g.:

embarcadero.newsgroups.archived.at/public.delphi.oleautomation/201008/1008111153.html
stackoverflow.com/questions/2449411/delphi-6-oleserver-pas-invoke-memory-leak
www.delphigroups.info/2/41/73231.html
forum.delphi.cz/index.php/topic,14291.0.html

I have only quickly glanced over them; the StackOverflow answer seem to be quite interesting and relevant to our case. From what I can tell, it's a Delphi issue. We do not control any of the Delphi-side code that has to do with accessing COM objects, and it is some Delphi object that is being leaked.

If we are given arguments indicating that the problem is in the QuickOPC component itself, OR - even if it's not - a hint of how the component side can somehow provide a workaround for it, we will have another look at it. Otherwise, it's up to the consuming side to somehow deal with it...

Best regards
Last edit: 03 Nov 2016 08:55 by support.

Please Log in or Create an account to join the conversation.

More
03 Nov 2016 07:04 #4533 by RH
Replied by RH on topic Memory leaks TEasyUAClient
I checked it again and the console application also shows the memory leaks, but only when running it in a previously opened console window. So there is no difference to the leak in my application except the additional leak of an instance of TEasyUAClient, because it is not destroyed after using it.

I did not copy your code. I free the instances of TEasyUAClient, when I don't need it anymore. That's the only object type that I create on my own. But it is obviously not enough to call Free. I also tried the explicit call of the Disconnect procedure, but it didn't help (I think it's called anyway by the parent destructor).

Fortunately, the leaks are not very large and won't probably cause problems for now. But anyway I would like to have it fixed.

Regards

Please Log in or Create an account to join the conversation.

More
02 Nov 2016 15:02 #4529 by support
Replied by support on topic Memory leaks TEasyUAClient
It is quite possible that our example code for Delphi is buggy in this respect - i.e. that it does not free the objects as it should. We may fix that in the future, but it should be mad clear that the main intent of the examples is to show how to invoke various functions in the product - and not to provide a "full" application code. And, we are no Delphi experts here, Delphi is just one of the tools that can be used with QuickOPC.

Isn't it so that the console application (our examples) simply does not detect/display the memory leaks the way the VCL applications does? That would explain why, even with leaks present, our (console-based) Delphi examples do not report it.

And, in the case of you VCL application, do *you* actually dispose of all the objects - or did you just copy over our code?

Regards

Please Log in or Create an account to join the conversation.

More
02 Nov 2016 13:08 - 02 Nov 2016 13:11 #4525 by RH
Hello,

I have an issue with memory leaks when using instances of TEasyUAClient in Delphi. It doesn't appear on your provided test application, but this is also not a VCL Application like I have.

When I close my application, I get one instance of TServerEventDispatch for each instance of TEasyUAClient I used. In the case of my screenshot, I used 2 instances of TEasyUAClient:



What am I doing wrong here? Or is this normal in a VCL Forms application? I wonder, why there are no leaks in your test application, as the instances of TEasyUAClient are not freed at all.

Best regards.
Attachments:
Last edit: 02 Nov 2016 13:11 by RH. Reason: topic corrected

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.061 seconds