FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

NetworkVariableDataSource.Bindings[VariableName].GetValue() leaks memory

Mamum -

 

We've been looking at this aggressively in R&D over the last couple of days. We have not been able to produce a leak in NetworkVariableBinding.GetValue (or in any use of NetworkVariableDataSource or NetworkVariableBinding). I realize that this is contrary to what Eric B reported - the test itself had a flaw (as opposed to a flaw in MStudio).

 

I'd like to try to find the problem you're seeing. Until we figure it out, we can't rule out the possibility that there is a leak in an MStudio component.

 

Here are the avenues I suggest we go down to try to get to the bottom of this:

 

1) Comment out all your calls to VariableDataSource.Bindings[VariableName].GetValue().ToString() and replace them with code that returns a constant string. Run your leak test again and let us know if you see a leak.

2) Post a small web site project that reproduces the leak. Include one of your user controls and the UpdatePanel and AsyncPostBackTrigger exactly as you are using them in your real application, in which you are seeing the leak. I realize that you posted some code already, but I am concerned that cobbling that code together into a runable application will change the charactaristics that cause the leak (this is basically what happened when we thought we saw the leak originally).

3) Reconsider your code that stores a reference to a NetworkVariableDataSource in SessionState. This is not the way that this component is intended to be used. It is expected that, like all server-side ASP.NET controls, a new instance of the NetworkVariableDataSource is created on each post back to the server. I don't see the code that initially creates your NetworkVariableDataSource and NetworkVariableBinding instances. Depending on how you are doing that, this could possibly be the source of your leak.

4) Consider investing in a memory profiler and see if it can show you what objects are actually leaking. We've had success with products from SciTech (http://memprofiler.com/) and Red Gate (http://www.red-gate.com/).

 

David Rohacek

National Instruments

0 Kudos
Message 11 of 22
(4,692 Views)

Mamum -

 

I have some additional questions:

 

5) How are you measuring memory consumption? Are you looking at Performance Monitor? Which performance counters? In what process (or machine-wide)?

6) Are you using IIS (and what version) or the development web server included with Visual Studio?

 

David Rohacek

National Instruments

0 Kudos
Message 12 of 22
(4,685 Views)

David-

 

We have tested your suggested test cases.

 

1) If we coment out NetworkVariableDataSource.Bindings[VariableName].GetValue() and use some constant value, we dont get incresiing memory consumtion

 

2) Even in the small project we have got same problem

 

3) N/A

 

4) We used .Net memory profiler and saw alive instances are getting more.

 

5) We measured memory consumption by worker process of performance monitor

 

6) We are using IIS (version both 5.1 and 6)

 

Beside we have got another defect that suddenly some of variables lost their reference and read unexpected value.

 

If you wish we are ready to show our whole application or related perticule working area. We need to solve this problem soonest possible.

 

regards,

Mamunur Rashid

Software Engineer

TechnoVista Limited

0 Kudos
Message 13 of 22
(4,618 Views)

Dear Dabid,

 

There is another problem on VariableDataSource.Bindings[VariableName].GetValue().ToString().

 

When I delete variable from variable manager, this method still gives me value (previous value) where I expect an exception or some thing else.

 

regards,

Mamun

0 Kudos
Message 14 of 22
(4,614 Views)

Mamum - 

 

2) Can you please zip up the small project that shows the problem and post it to this forum? I want to make sure that I can reproduce the exact leak you are seeing.

4) What is the fully-qualified name of the class that has instances increasing over time?

5) What is the exact name of the performance counter you are using (e.g., "# Bytes in All Heaps")?

 

David Rohacek

National Instruments

0 Kudos
Message 15 of 22
(4,597 Views)

David--

 

1) I will send u the project later (since I am middle of another work now).

 

2)The user controls class instances get higher

 

3) I used Page File Byte as counter

 

regards,

Mamun

0 Kudos
Message 16 of 22
(4,587 Views)

David,

this post inclueds installation guideline and web application.

Download All
0 Kudos
Message 17 of 22
(4,563 Views)

David,

 

if you have any additional feedback on the project after code review, plz inform me.

 

thanx
0 Kudos
Message 18 of 22
(4,559 Views)

Mamum -

 

I was able to get your web project built and running on a test machine here. However, it is not obvious to me what I need to do to reproduce the memory leak.

 

I run the LabVIEW VI InitSVE. I open the default page on the your web site and the StackOperation.aspx page is opened.  None of the controls on the page update on the timer (I was thinking the controls would be updated through the Network Variable Data Source bindings). After a few seconds, the web page dims and the following error message is shown: "Note: Use the Browser Back Button To Navigate to a Different Controller". A few seconds later, a Windows popup is shown with the following error message: "Sys.WebForms.PageRequestManagerTimeoutException: The server request timed out.".

 

This simplified application that you posted is still quite complex. I see three options from here:

1) Post explicit step-by-step instructions on what we need to do to reproduce and measure the memory leak in the application that you posted.

 

2) Create and post the most minimal, bare-bones web application that reproduces the memory leak, along with step-by-step instructions we can follow to reproduce and measure the memory leak.

 

3) Have one of our support engineers contact you directly, by phone, to walk through the steps needed to reproduce and measure the memory leak in the application that you posted. If you choose this option, please provide explicit permission in your response to this post to allow us to get your contact information from your ni.com profile.

 

 

David Rohacek

National Instruments

 

 

0 Kudos
Message 19 of 22
(4,528 Views)

David,

 

I can communicate you over phone  or yahoo/msn messenger. Beside this, you can give me permission of remote access to a pc so that I an set the project there.

 

Mamun

 

 

 

0 Kudos
Message 20 of 22
(4,514 Views)