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.

OutOfMemoryException in PullMultipleDataChangeNotifications results

More
05 Feb 2020 17:35 #8201 by Boris
Thanks for the quick response. I did not have time to answer immediately. I updated on February 1 and sent a new version to the user for tests. Now I am waiting for the results.

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

More
01 Feb 2020 12:37 - 01 Feb 2020 13:21 #8193 by support
I have reviewed the related code in QuickOPC. And I found, in fact, a potential for a memory leak in properties/methods that return timestamps. This is only in COM API, due to a complicated issue with round-tripping the conversions of date/time between .NET and COM. I can imagine that this might have been a problem, but it is not clear to me why it would only give OutOfMemoryException but not really show as true memory increase; but maybe that was due to the method used to observe the memory.

So, I have fixed this problem, and and we will see whether it will have the desired effect. The fix is is in the latest QuickOPC 2019.2, build 5.56.1055.1 or later.

Best regards
Last edit: 01 Feb 2020 13:21 by support. Reason: Corrected 2019.1 to 2019.2

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

More
31 Jan 2020 10:50 #8190 by Boris
Unfortunately this is not a very reliable number, it is taken from the Windows task manager. Columns "Memory (working set)" and "Memory (private set)". Both columns showed about 300 MB at the time the error occurred.
Recently, I asked the user to write a report in program "PerfMon" so that the values are accurate. Hope he can do it soon.

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

More
31 Jan 2020 09:27 #8189 by support
I have some idea, but I am not sure yet.
First I want to ask some question:

You wrote "The application takes up about 300 MB of memory at the time the problem is detected.". Where is this number taken from? When you write "there are no signs of memory leak", which tools you use, or how have you come to this conclusion?

Kind regards

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

More
30 Jan 2020 18:25 #8184 by Boris
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?

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

Moderators: support
Time to create page: 0.051 seconds