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.
Memory leak in QuickOPC nuget
you have a license purchased on 5/23/2022 without upgrade assurance. That means that it only covers the versions released max. 60 days after the purchase date. So, according to kb.opclabs.com/Versions , this comes to maximum version 5.63 (2022.1).
We only make bug fixes to the current version, that's why it has been made into QuickOPC 5.70 (2022.2).
Normally you would therefore need to purchase an upgrade in order to use QuickOPC 2022.2. But since you were instrumental in finding this "valuable" bug, you will get a kind of bounty, and you will receive a license key that covers version 2022.2. I will send it to you by email.
Best regards
Please Log in or Create an account to join the conversation.
- janko.mihelic@adnet.hr
- Topic Author
- Offline
- Elite Member
- Posts: 24
- Thank you received: 1
But I cannot use this new nuget because my license doesn't work with it. Was there a license break put in before fixing this memory leak? Is there any way to get a nuget without a memory leak that will work with my license?
Please Log in or Create an account to join the conversation.
I was able to get the event flow now. And, I was able to reproduce the memory leak.
It should be now fixed. The fix is in QuickOPC 5.70.1012.1 or later, which is on our Web site, and on nuget.org.
Please rebuild with this new version, and retest.
Thank you for reporting the issue!
Best regards
Please Log in or Create an account to join the conversation.
- janko.mihelic@adnet.hr
- Topic Author
- Offline
- Elite Member
- Posts: 24
- Thank you received: 1
Please Log in or Create an account to join the conversation.
still no flow of events from the server.
Regards
Please Log in or Create an account to join the conversation.
- janko.mihelic@adnet.hr
- Topic Author
- Offline
- Elite Member
- Posts: 24
- Thank you received: 1
Please Log in or Create an account to join the conversation.
The OPC UA server on opc.tcp://opcua.adnet.hr:81 does not give me any events, except for a single condition that remains static (in initial Refresh). This is true both in my test client code with QuickOPC, AND using UaExpert, as shown on following pictures.
If there is a different notifier node to be used, or some other trick to make it work, let me know.
Regards
Attachments:
Please Log in or Create an account to join the conversation.
- janko.mihelic@adnet.hr
- Topic Author
- Offline
- Elite Member
- Posts: 24
- Thank you received: 1
I made a public test OPC-UA server so that we can have the same environment. It's a docker container from this repository:
github.com/Azure-Samples/iot-edge-opc-plc
The link is:
opc.tcp://opcua.adnet.hr:81
You will only have to accept the opc-ua server certificate (I connect with UAExpert, and copy the certificate to C:\ProgramData\OPC Foundation\CertificateStores\UA Applications\certs).
It has a configuration that has two cycles, first a few minutes of a lot of events (about 5000), as fast as it can send, and then a few minutes of one event per second. The expectation is for the server to release the memory during the time it has fewer events, but that never happens. It just retains the memory. Here is a link to the gist that shows how I created the docker environment for the test opc-ua server:
gist.github.com/Janjko/7ed142f5530374ca7e45f01046d6754c
I successfully connected with it from outside of our network with the client we already sent here (just with a different link to the opc server), and I see a steady incline in memory usage. This persisted for several hours, here is a graph of around 15 min:
Please Log in or Create an account to join the conversation.
I was unable to reproduce the problem. Here is what I did:
1. I took your console-based program.
2. Made a special change to our currently released version (2022.2) to generate 1000 identical event notifications (instead of just 1) at the point we received them from the OPC UA stack, so that I can simulate a higher rate of notifications than what the server actually provides.
3. Changed it to reference the above special build of our currently released version.
4. Change the endpoint URL to point to my local Prosys simulation server.
5. Commented out the unused data change handler, only kept the event notification handler.
6. Ran the program and monitored the Private Bytes using PerfMon.
Memory consumption chart of cca 12 hours run:
For record, the program now looks like this:
using OpcLabs.EasyOpc.UA;
using OpcLabs.EasyOpc.UA.AddressSpace.Standard;
using OpcLabs.EasyOpc.UA.AlarmsAndConditions;
using OpcLabs.EasyOpc.UA.OperationModel;
using System;
namespace OpcLabsBug
{
internal class Program
{
private static EasyUAClient client;
[MTAThread]
static void Main( string[] args )
{
client = new EasyUAClient();
subscribe();
Console.ReadLine();
}
private static void subscribe()
{
UAEndpointDescriptor endpointDescriptor = new UAEndpointDescriptor( "opc.tcp://localhost:53530/OPCUA/SimulationServer" );
if ( client == null )
client = new EasyUAClient();
client.EventNotification += Client_EventNotification;
UAAttributeFieldCollection uAAttributeFields = UABaseEventObject.AllFields;
int eventMonitoredItem = client.SubscribeEvent(
endpointDescriptor,
UAObjectIds.Server,
0,
uAAttributeFields );
}
//private static void ProcessDataChange( object sender, EasyUADataChangeNotificationEventArgs eventArgs )
//{
// if ( eventArgs.Succeeded )
// {
// string recordId = eventArgs.Arguments.NodeDescriptor.NodeId.ExpandedText;
// var value = eventArgs.AttributeData.Value;
// var time = eventArgs.AttributeData.SourceTimestampLocal;
// Console.WriteLine( $"Value change: {recordId} - {value} - {time}" );
// }
//}
private static void Client_EventNotification( object sender, EasyUAEventNotificationEventArgs e )
{
if (e.EventData == null)
return;
var Time = Convert.ToDateTime( e.EventData.FieldResults[UABaseEventObject.Operands.Time].Value ).ToLocalTime();
var EventText = e.EventData.FieldResults[UABaseEventObject.Operands.Message].Value.ToString();
Console.WriteLine( $"Event: {EventText} - {Time}" );
}
}
}
I do not know what causes the difference between your and my observation, but I suggest you retest your scenario(s) with our current version (2022.), to see if that does not resolve the problem for you. There was no fix made into this version for such memory leak, but there was a large amount of other changes, and therefore it is possible that there was an "incidental" fix.
If you still get the memory leak problem with version 2022.2, then make sure you provide me with truly reproducible scenario.
Best regards
Attachments:
Please Log in or Create an account to join the conversation.
Note that I will be using the recent released version (2022.2), which is newer than you could have used. There was no specific fix for a memory leak in this version, but we do not officially support older versions, and if any code change results from the investigation, it would only be made to the newest version anyway.
Regards
Please Log in or Create an account to join the conversation.