“server_com_da_migration” sample server leaks memory when connected to UaExpert Performance view
Posted: 04 Sep 2020, 16:55
Hi Support Team,
We are using Unified Automation UA SDK C++ Server Professional 1.6.3 in our OPC UA server. We use visual studio 2015 for our development.
We are following sample server “server_com_da_migration” for our OPC server development.
We have our own NodeManager implementation.
If we connect to UaExpert performance view with “server_com_da_migration” sample application , we can see the steady increase in the memory.I have run the performance test just 30 minutes. There is a very huge memory increase. Just selected the "Write" alone in the UaExpert with 6 nodes.
We tried using separate group m_pReadWriteGroup for Read/Write . Please see the code snippet below.
Still we see memory increase.
void OPCUAIOManagerJob::executeWrite()
{
//TODO: Verify with next version that this is how the WRITE should work
HRESULT hr = S_OK;
OpcUa_UInt32 count = m_pTransactionContext->m_nAsyncCount;
OpcUa_UInt32 i;
OPCHANDLE* pServerHandles = (OPCHANDLE*)CoTaskMemAlloc(count*sizeof(OPCHANDLE));
VARIANT* pValues = (VARIANT*)CoTaskMemAlloc(count*sizeof(VARIANT));
HRESULT* pErrors = NULL;
for ( i=0; i<count; i++)
{
pServerHandles = m_pTransactionContext->m_arrUaVariableHandles->m_serverHandle;
pValues = VARIANT(UaVariant(m_pTransactionContext->m_arrWriteValues->Value));
}
hr = m_pTransactionContext->m_pReadWriteGroup->Write(
count,
pServerHandles,
pValues,
&pErrors);
----
---
---
removeItems(pServerHandles, count);
}
Any help on this would be appreciated.
Thanks
Antoni
We are using Unified Automation UA SDK C++ Server Professional 1.6.3 in our OPC UA server. We use visual studio 2015 for our development.
We are following sample server “server_com_da_migration” for our OPC server development.
We have our own NodeManager implementation.
If we connect to UaExpert performance view with “server_com_da_migration” sample application , we can see the steady increase in the memory.I have run the performance test just 30 minutes. There is a very huge memory increase. Just selected the "Write" alone in the UaExpert with 6 nodes.
We tried using separate group m_pReadWriteGroup for Read/Write . Please see the code snippet below.
Still we see memory increase.
void OPCUAIOManagerJob::executeWrite()
{
//TODO: Verify with next version that this is how the WRITE should work
HRESULT hr = S_OK;
OpcUa_UInt32 count = m_pTransactionContext->m_nAsyncCount;
OpcUa_UInt32 i;
OPCHANDLE* pServerHandles = (OPCHANDLE*)CoTaskMemAlloc(count*sizeof(OPCHANDLE));
VARIANT* pValues = (VARIANT*)CoTaskMemAlloc(count*sizeof(VARIANT));
HRESULT* pErrors = NULL;
for ( i=0; i<count; i++)
{
pServerHandles = m_pTransactionContext->m_arrUaVariableHandles->m_serverHandle;
pValues = VARIANT(UaVariant(m_pTransactionContext->m_arrWriteValues->Value));
}
hr = m_pTransactionContext->m_pReadWriteGroup->Write(
count,
pServerHandles,
pValues,
&pErrors);
----
---
---
removeItems(pServerHandles, count);
}
Any help on this would be appreciated.
Thanks
Antoni