LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI that gets bigger every time it runs

A while-loop with and without a small delay in it gives extremely different results in memory demand.
Try it and you should see the result.

I believe (if I am not wrong) that the build array method that your vi is employing will only keep on building up, thus the memory usage. This can be estimated only if you do an Array Initialisation to a known est. array size.

I guest the above also explains why the Task Manager is keep on increasing ?? Someone else might be able to give you better answer 🙂

I have a program for Battery Life Characterisation which streams one reading at every 2 sec over a period of more than 280 hrs. Of course, do bear in mind that I only have one array to handle with.

Last but not leas
t, I will be off line for now. Should you have further question, do post it here and there are many enthusiasts here to answer your Qs. I will, of course, try to attend to your Qs asap.

Cheers
ian
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 11 of 18
(1,038 Views)
As Ian indicates - the only thing that might restrict how fast the main loop is running and thus how fast the arrays grow is the get data VI...

Continously building the arrays using array inserts is not a very effective teqnique. You probably know at least aprox. how much data you will get so I would use presized arrays, the replace function and an index counter instead; circular buffers would be good, or as Ian sais - stream data to a file instead of keeping it in memory.
0 Kudos
Message 12 of 18
(925 Views)
Hi 🙂

I tried adding delays to some of my VIs as you, Ian, suggested, and it actually worked!! I've been running the program for hours now and when I look at Tools-> Advanced-> Profile VIs, it tells me that not one of the VIs are growing.

However, LabVEIW.exe is still steadily and constantly increasing its demand for memory space (Task Manager).

So, when the program is running, LabVIEW is not showing that the system requires more memory space as time passes, but at the same time the Task Manager tells me that it's increasing.

Is there anything that I could do in LabVIEW or elsewhere to stop the LabVIEW.exe file from growing?

Thanks again to both of you for helping me 😄

-Margrete c",)
0 Kudos
Message 13 of 18
(925 Views)
Hi 🙂

I tried adding delays to some of my VIs as you, Ian, suggested, and it actually worked!! I've been running the program for hours now and when I look at Tools-> Advanced-> Profile VIs, it tells me that not one of the VIs are growing.

However, LabVEIW.exe is still steadily and constantly increasing its demand for memory space (Task Manager).

So, when the program is running, LabVIEW is not showing that the system requires more memory space as time passes, but at the same time the Task Manager tells me that it's increasing.

Is there anything that I could do in LabVIEW or elsewhere to stop the LabVIEW.exe file from growing?

Thanks again to both of you for helping me 😄

-Margrete c",)
0 Kudos
Message 14 of 18
(925 Views)
Hi 🙂

I tried adding delays to some of my VIs as you, Ian, suggested, and it actually worked!! I've been running the program for hours now and when I look at Tools-> Advanced-> Profile VIs, it tells me that not one of the VIs are growing.

However, LabVEIW.exe is still steadily and constantly increasing its demand for memory space (Task Manager).

So, when the program is running, LabVIEW is not showing that the system requires more memory space as time passes, but at the same time the Task Manager tells me that it's increasing.

Is there anything that I could do in LabVIEW or elsewhere to stop the LabVIEW.exe file from growing?

Thanks 🙂

-Margrete
0 Kudos
Message 15 of 18
(1,038 Views)
hi,

what I can suggest is to

1. Try Initialize the arrays to a known array-size.
2. Replace the "Insert into array" for [Add to array.vi] with "Replace array subset"

Again, as your vi builds huge array size over time, I would suggest you to use data streaming method.

Attached is a rough idea of how an array can be initialized and replaced using "Replace Array Subset"

regards
ian
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 16 of 18
(925 Views)
Hi again Ian 😃

Unfortunately, I cannot open your attachment because I've only got LabVIEW version 6.0.2.
However, the arrays that I make (in MAIN.vi) would at the very maximum get as big as 600elements, somewhere between 300 and 600. I've checked that once the 5min pulse is generated, these arrays are deleted (replaced with empty arrays, and they start building again from scratch. So once every 5minutes the arrays of MAIN will be empty. -Would you still say that "my vi builds huge array size over time? I'm not familiar with data streaming, but every five minutes I'm writing my data to file... I'm also handling arrays in Make Data for Day and Week display. Here they are a fixed size of 288
and I use the Replace -function instead of the Insert function...

Since I am deleting the biggest arrays every 5minutes, I find it strange that they are the reason why my program is increasing its memory usage. However, as I mentioned before, it does not grow in Tools-> Advanced-> Profile VIs, only the LabVIEW.exe file grows.

The LabVIEW.exe file also increases in memory when I more LabVIEW windows are activated. Since I'm displaying three of the VIs on the Internet these VIs have to be active and that makes the LabVIEW.exe file even bigger.

Thanks again!!!!

Kindly,
Margrete c",)
0 Kudos
Message 17 of 18
(925 Views)
hi margrete,

My apologies for saving them in LV6.1
I am now in my office now and I don't have the modified VIs with me. I will make a copy in LV6.0.2 for you this evening.


PS:
I am not sure I should upload it here (as it is taking up the memory space??). Send me an email at labview@ianfung.net and I will forward the VI to you. Else, I will upload it here.

Regards
ian
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 18 of 18
(925 Views)