LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

memory leak with 3d plot

Dear all, I have a sub-vi, that saves figures using 3d plot. It works fine several times, but after a while it runs out of memory and crashs. I have attached a simplified version, which runs once, but crashes after a while in a loop. (I use the reference to 3d plot, because otherwise the data would not appear in the saved picture.) Thanks in advance for your help! Regards E.T.

0 Kudos
Message 1 of 8
(3,455 Views)

I will not call it a "memory leak" since that term is usaully reserved for lossing memory and not being about to recover it.

 

Your code demonstrates that the XControl was not implemented very efficiently. Judging by the helper VIs and the lack of documentation therin and the pletera of buffers required, I suspect someone that who has not bothered to read the various post available on this forum about performance and efficient use of memory.

 

You build an array of 50MBytes that when passed the XControl (3D plot) demands more than 15GBytes of memory. So that looks like works out to for each byte of info you wnat to plot, it requires 30X or more to render the display.

 

If you want to stick with the shipping code, you will have to severly limit your data set size.

 

If you choose to "roll-your-own" 3D stuff, you may be abel to get a larger data set.

 

That is all I can offer,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 8
(3,436 Views)

I have made the example just to demonstrate the effect, that the vi works fine for the first time but crashes when run several times. Therefore I set the array quite large, so it still works in the first run (at least on my PC with less than 15GB memory) but crashes when called the second or third time. In the real application the array is smaller but the vi crashes after about 200000 calls. The task manager shows, that the amount of memory allocated by LabVIEW increases slowly when running this application. The memory is not freed when the vi stops, but after closing LabVIEW. Therefore I thought it is a memory leak.

Regards

E.T.

0 Kudos
Message 3 of 8
(3,429 Views)

In the case of 200000 successful calls I had to restart the application once a day and it managed to run through several data sets. This was acceptable, but to increase the resolution I have increased the array size by a factor of four and now it crashes after 100 (once after 1000 calls). This is not acceptable, as it does not managed to go through one data set before crashing.

Regards

E.T.

0 Kudos
Message 4 of 8
(3,422 Views)

I have requested an Application Engineer from NI take a look at this issue.

 

I will watch for updates.

 

Take care,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 8
(3,418 Views)

I ran into the same trouble,

is there anything new on this issue?

regards, Tom

 

0 Kudos
Message 6 of 8
(3,309 Views)

@tleisner wrote:

I ran into the same trouble,

is there anything new on this issue?

regards, Tom

 


I guess the answer is going to be the same.  Be efficient with array handling.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 8
(3,297 Views)

 

Thank you for the quick, reply, even if it did not really help.

 

After a lot of experimenting I discovered, that the problem appears only if "overlay" is set to "points" or "lines" or "both" in the 3D graph properties and certainly has nothing to do with my handling of arrays.

Setting overlay to "none" solved the problem for me, even though I am not able to plot thick lines in the 3D line graph.

Tom

 

 

Message 8 of 8
(3,254 Views)