From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory leak in WPF graph (VectorRenderTarger )

I check memory leak on the WPF graph.

I see that there is a variable that called: VectorRenderTarger, and it never erased from the memory.

 

The amount is always changing depending on the number of existing plots on the screen (in the attached project is six plots every time).

 

When I clear the data & add new data - new (6) VectorRenderTarger variables are added, and the old (6) not erased from the memory.

 

Is there a way to make this variable to be removed from memory?

0 Kudos
Message 1 of 9
(6,439 Views)

Hi,

Could you indicate in which file you see this variable? 

 

Best Regards,

T. Le
Vision Product Support Engineer
National Instruments
0 Kudos
Message 2 of 9
(6,415 Views)

I do not see this variable in visible files, but rather through software that finds memory leaks in the system.

 

In order to check the leakage actually derives from NI and not from our system I created the project attached, and this variable is added all the time and never deleted.

 

I attached the picture of the tree that present in the leaks software, so you can see how the variable is held.

 

memory_leak_tree.PNG

(This picture represents a variable that was supposed to be deleted).

0 Kudos
Message 3 of 9
(6,382 Views)

Hi,

Is your project a NI WPF Application? This variable does not come up when you create a regular WPF Application? 

T. Le
Vision Product Support Engineer
National Instruments
0 Kudos
Message 4 of 9
(6,336 Views)

My project is a regular WPF application with NI graph. the project attached in the first message.

0 Kudos
Message 5 of 9
(6,324 Views)

Hi,

According to the tree I've provided before: the problematic variables are in NotifyingCollection<IRenderTarget>.
I saw such list in DataPlotArea class, named RenderTargets.

 

Could it be that the list is not cleaned properly? or there are objects that register to events in this list that are not unregister when removed?

0 Kudos
Message 6 of 9
(6,234 Views)

Hi, 

Which software are you using to find the memory leaks? Also, a work around I could suggest is to try using another Render Mode. If you switch to "Raster" for example, do you still see the same behavior? 

 

T. Le
Vision Product Support Engineer
National Instruments
0 Kudos
Message 7 of 9
(6,214 Views)

When I switch to Raster or HW I do not have this problem. But I want to use Vector, can I work around this problem?

0 Kudos
Message 8 of 9
(5,380 Views)

Hello, we also have the same problem with our customers.

For some reasons only Vector mode can be used for our product using NI graph.

And we faced with the same problem. 

0 Kudos
Message 9 of 9
(2,939 Views)