Register    Login
 
OPC Professionals
At Your Disposal
 
 
SupportOnline Forums
 

Links: Related Pages
 
Links: Related Services
 
Links: Related Support
 
Links: Related Resources
 
Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see link in upper right corner) in order to Post questions. You do not have to be a licensed user.

OPC Labs team is actively monitoring the forums, and provides answers as soon as possible. For your convenience, we have also assembled a Frequently Asked Questions page.

Please do not use the Contact page for technical support.

HINT: You may use the Search feature (magnifier icon below) in the forums to locate the information you need. You can also search our entire Web site (the search box in the upper right corner of every page).

 
 
SupportSupportDiscussions (re...Discussions (re...QuickOPC-ClassicQuickOPC-ClassicQuickOPC.NET  QuickOPC.NET Unmanaged memory leak?Unmanaged memory leak?
Previous Previous
 
Next Next
New Post
 9/3/2010 9:37 AM
 

I am using version 5.0.1321.1 of EasyOpcDANet.dll to poll ~ 1800 tags from an OPC server, some at a rate of 500 ms and some at a rate of 100 ms, and I think I'm experiencing a memory leak in the driver.

I use the SubscribeMultipleItems method to subscribe to the 1800 tags at program start. After about a day, the program is using well over a gig of virtual memory. We log both the private bytes (unmanaged) and the .NET CLR bytes in all heaps. The .NET CLR bytes in all heaps flututates up and down as you would expect over normally GC cycles, but on average remains relatively constant. The private bytes, however, increase linearly at a rate of about 50 megabytes/hour. We are not using any unmanaged code from our application, which leads me to believe it is an issue with the EasyOpcDANet.dll.

Is there anything we have to do to release unmanged memory?

Please advise, thanks.

New Post
 9/3/2010 9:53 AM
 
 Modified By OPC Labs Technical Support  on 9/3/2010 5:54:25 PM

Thank you for your post.

There should be no need to do anything explicitly for the unmanaged memory used by EasyOpcDANet be released. In some situations, the constant memory grow is "normal" - it can be caused by the application not being able to cope with the influx of the data changes; the internal queues that consume memory will grow to a set limit, and the default is quite high (100,000 events) - if you are in such situation, you would know by symptoms such as that you will not receive the expected number of updates per certain period, and the timestamps of incoming data will become increaasingly delayed behind the current time. Pausing the updates (somehow) on the server side would cause the remaining queued events be dispatched to the application, and the memory would eventually shrink back to normal. I assume you do not have such symptoms - please confirm.

I will set up a test similar to yours, and attempt to reproduce the problem.

Best regards,

Zbynek Zahradnik

New Post
 9/3/2010 10:39 AM
 

Thanks for the prompt response.

I had a typo in my post - should say 500ms and 1000ms, not 500ms and 100ms.

We notice that eventually the EasyOPCDANet driver will stop sending updates (or sending the same old value over and over, I'm not sure, but I would suspect the former).

I will put in some logging to determine whether the timestamps start lagging behind the current time.

The system we're running on is a Windows Server 2k3 box with 4 GB of RAM and 4 processors with the overall CPU percentage usually around 10-15%.

I'm attaching a screenshot of the memory profile. I had to restart the program twice in the shown interval (indicated by the sudden drop in memory). You can see the steady increase of the dark blue line (private bytes). The light blue line is process elapsed time. The green line is managed memory usage in all heaps (ranges between 46 megs and 57 megs)

 memory usage.jpg
New Post
 9/7/2010 10:55 AM
 

The OPC Server we are connecting to is RSLinx - I am not sure how to stop it from sending updates to our program, but will try and figure it out.

With each tag I am now displaying the TimeStamp from the VTQ object, which will let us know if we start lagging behind.

As it stands I have to log into my customer's system and restart our program once a day so it does not run out of memory. Have you been able to reproduce the issue?

New Post
 9/8/2010 4:25 AM
 

It seems that I have been able to reproduce the problem, or at least something very similar. As such, no further action is required on your side right now. I will investigate into what could be the cause.

Previous Previous
 
Next Next
SupportSupportDiscussions (re...Discussions (re...QuickOPC-ClassicQuickOPC-ClassicQuickOPC.NET  QuickOPC.NET Unmanaged memory leak?Unmanaged memory leak?

 
 
 
 
 

 
 
 
 
Home|Services|Products|Purchase|Downloads|Support|Resources|Company|Contact
Copyright 2007-2011 by OPC Labs Terms Of Use Privacy Statement February 5, 2012