Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Importance of history capacity in case of graphs

Hi there,

 

I am using scatter graph having multiple plots. There is a huge data to be plotted on the graph, therefore I have set the history capacity of every plot to be 500000.

 

My question is:

 

1. In case of graphs is there any need to set the history capacity.

 

2. Does panning and zooming haas anything to do with the history capacity property.

 

3. Why panning causes the out of memory exception? and whats the best way to deal with this.

 

Regards,

Naureen.

0 Kudos
Message 1 of 4
(5,632 Views)

Hey Naureen,

 

We have a document in the Measurement Studio help file about optimizing the performance of scatter and waveform graphs:

 

http://zone.ni.com/reference/en-XX/help/372636F-01/mstudiowebhelp/html/optimizingnetscatterwaveformg...

 

The HistoryCapacity property is mentioned in the "Configuring the Plot for Optimization" section. Basically, HistoryCapacity is only used if you append data using a method such as PlotYAppend, rather than just graphing the data directly with a method such as PlotY. If you aren't appending data, the HistoryCapacity value is not used.

 

As far as panning and zooming, since HistoryCapacity defines how many points are saved--regardless of whether they are visible onscreen or not--it would certainly have an effect on your ability to view data not currently in the window. If you're simply wanting to zoom in on data already visible onscreen, HistoryCapacity will not affect your functionality.

 

Could you clarify what's happening when you see the out of memory exception? I'm curious when exactly you see the error, and how many points you're displaying in the graph. I'd also recommend looking through the document I linked above--some of those optimizations might help performance and keep the error from appearing.

0 Kudos
Message 2 of 4
(5,607 Views)

Hello,

 

Actually when I keep on panning without releasing the mouse button, within few seconds the Out of Memoey exception is thrown. I dont know how to deal with it as I am using the PanX and PanY property of the scatter graph.

 

Regards,

Naureen.

0 Kudos
Message 3 of 4
(5,579 Views)

Hey Naureen,

 

I found another forum post that seems to reference a similar issue, here's a link: http://forums.ni.com/t5/Measurement-Studio-for-NET/Very-large-scattergraph-out-of-memory-exception/m...

 

Basically, the exception is being thrown because your application is using too much memory--the graph itself does not have a limit on how much memory it can use, but your system does. You could check the memory usage of your application using GC.GetTotalMemory or System.Diagnostics.Process.GetCurrentProcess().PrivateMemorySize64, or use Windows Task Manager to see what the memory usage on your system looks like.

 

I suspect that if you decrease the history capacity of the graph (or the number of points plotted to the graph) the exception will disappear. Is  there any way you can reduce the memory usage of your code, or perhaps close any other open applications on your computer to free up memory?

0 Kudos
Message 4 of 4
(5,566 Views)