Hello.
Our program has been working steadily for more than a year. All this time we used the components of version 2018.3 (5.54.1281.1). Users use the program with different OPC-UA servers. And everything was fine until recently. One of the users encountered an error. He subscribes to 1076 tags of the OPC-UA server "WAGO 750-8202 PFC200 2ETH RS". Subscription is carried out through the function "SubscribeMultipleMonitoredItems". Changes come through the "PullMultipleDataChangeNotifications" function. Everything works stably for about 7-10 days. Then we start getting the error "System.OutOfMemoryException". I marked the place of error with a comment:
procedure TMy_UAServer.ProcPullDatachange;
var
aChangeArray: PSafeArray;
aSyncArray: OleVariant;
aTimestamp: TDateTime;
aChange: _EasyUADataChangeNotificationEventArgs;
begin
try
aChangeArray := Server.PullMultipleDataChangeNotifications(50);
except
Exit;
end;
if aChangeArray = nil then Exit;
tagVARIANT(aSyncArray).vt := varArray or varVariant;
tagVARIANT(aSyncArray).PArray := aChangeArray;
for I := VarArrayLowBound(aSyncArray, 1) to VarArrayHighBound(aSyncArray, 1) do
begin
aChange := IUnknown(aSyncArray[I]) as _EasyUADataChangeNotificationEventArgs;
if aChange.Exception = nil then
if aChange.AttributeData.HasValue then
begin
aTimestamp := aChange.AttributeData.ServerTimestampLocal; // !!! System.OutOfMemoryException !!!
end;
end;
end;
The error occurs until the program is restarted. After restarting, the program runs stably again for 7-10 days and then the error occurs again. Interestingly, there are no signs of a memory leak. The application takes up about 300 MB of memory at the time the problem is detected. The problem is displayed only in the components of the OPC-UA. All other parts of our program (working with DBMS, files, reports and other tasks) work well. It was because of this problem that I decided to upgrade the components to version 2019.2.
Strange, now our program is used by more than 1000 users with other different UA-servers, but the problem arose only for the user with “WAGO 750-8202 PFC200 2ETH RS”.
Now I am trying to get more information about the problem. And if there is information, I will let you know. But maybe you know something about such a problem?