Hello Z,
I wanted to run something by you and see if I can get your thought on this. I am currently working with a customer that is experiencing some memory growth when using the OPC UA client object. Now, I believe we figured out why the memory was experienced and just want to run it by you.
We were able to replicate this by adding a While(1) to the ReadValue.Main.cpp Example:
void ReadValue::Main()
{
// Initialize the COM library
CoInitializeEx(NULL, COINIT_MULTITHREADED);
while(1)
{
// Instantiate the client object
_EasyUAClientPtr ClientPtr(__uuidof(EasyUAClient));
// Perform the operation
_variant_t value = ClientPtr->ReadValue(
/*L"
opcua.demo-this.com:51211/UA/SampleServer",
L"nsu=http://test.org/UA/Data/;i=10853");*/
L"opc.tcp://10.1.10.72:62541",
L"nsu=urn:inductiveautomation:ignition:opcua:tags ;ns=2;s=[default]/PROCESS/MANAGEMENT/INSTANCE/ADMIN/IsActive");
// Display results
_variant_t vString;
vString.ChangeType(VT_BSTR, &value);
_tprintf(_T("valuem: %s\n"), (LPCTSTR)CW2CT((_bstr_t)vString));
}
// Release all interface pointers BEFORE calling CoUninitialize()
CoUninitialize();
}
It looks like the resources are delay-released, so the memory will start to increase(we monitored the memory using task manager) whenever one reads over 100 values. However, once it pauses one can see the memory drop over several seconds. It looks to me that calling ReadValue() method that fast causes memory growth.
with that in mind I have a few questions:
- Have you experienced this in the past? If so is this expected? or in other words, are we correct on our assessment?
- Is there any Documentation talking about the limitation on how fast the ReasValue method can be called?
The customer is using the 5.61 Version of the toolkit. I will be testing with the new version as well so I will get back to you if I can replicate it with the new version as well.
-Rod