Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

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 8
(2,422 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 8
(2,398 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 8
(2,365 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 8
(2,319 Views)

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

0 Kudos
Message 5 of 8
(2,307 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 8
(2,217 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 8
(2,197 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 8
(1,363 Views)