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.
Continuous instantiation of EasyUAClient causes ever-growing (?) memory usage
Please Log in or Create an account to join the conversation.
Best regards
Please Log in or Create an account to join the conversation.
client = EasyUAClient()
client = EasyUAClient.SharedInstance
Is it OK to call client.Dispose() in both cases?
Please Log in or Create an account to join the conversation.
If it is only "you" (your code) using the shared instance, it is fine then.
The memory is managed by .NET. The fact that it has grown from 90 MB to 1 GB does not, by itself, show anything. .NET may use the memory if there is memory available. It knows how much memory is there, and its consideration is not to let the others starving - but not to minimize the memory usage just for the sake of it.
There can be memory leak, yes. And the cause for the leak can be in QuickOPC, in your code, or in something in between (pythonnet) But the acceptable proof of the memory leak would be something like that a) the process runs out of memory, b) there is a clearly growing trend in memory usage - but for that I will need to see PerfMon chart over a longer period of time (process Private Bytes counter). I have seen situations e.g. that .NET's garbage collector (GC) decided to keep the memory slowly growing for approx. 3 days, and only then do some cleanup.
It may be worth calling client.Dispose() before it gets out of the function scope.
Best regards
Please Log in or Create an account to join the conversation.
I am doing long running tests, and I noticed that my bare-bone python app memory usage was over 1 GB, it started from 90 MB.
I could boil down the issue to this code.
The write_value function is called continuously with 100 ms delay between invocations.
It seems to me as if each object of EasyUAClient would be added to a global collection.
Currently I use EasyUAClient.SharedInstance but I have read the drawbacks of it.
It is really my fault as I would have to instantiate only one EasyUAClient, I investigate further.
I would be appreciate if you could elaborate me on this EasyUAClient vs. EasyUAClient.SharedInstance topic.
I really appreciate your help.
Best Regards!
Please Log in or Create an account to join the conversation.