10-31-2008 01:05 PM
All
I recently wrote a small piece of software which is collecting data at a very high frequency and for a long time. This is the first time I am attempting to do something like this and have hit an issue with memory not being enough as the size of the Excel file increased.
Excel has a limit of about 65000 rows, but I have written only ~10000 rows when the following error showed up:
I can briefly tell you how the data acquisition loop works:
1) timed loop has a period of 1 minute.
2) there is a sequence structure in the loop.
3) first - a sub vi goes to agilent equipment and collects all the data
4) second - a sub vi processes all the data into individual arrays in preparation for writing them to the excel file
5) third - a sub vi writes all the arrays into a single Excel file (which is already open) and saves the file
6) then the timed loop checks if the condition is met for termination of the loop. If not, then it repeats steps 3, 4, 5 above.
Possible issues that may be causing the problem:
Appreciate all the help.
Thanks in advance.
10-31-2008 01:23 PM
Instead of writing to Excel try a regular txt file. Excel does have its limits for scientific engineering...2^16 rows and 2^8 columns, see Excel specs and sometimes due to memory limitations of your hardware....
10-31-2008 03:17 PM
Like I said in my email, I am only at about 10000 rows and the limit per worksheet is 65000. That is still way off.
And file size is only 23MB.
Can somebody help me understand the scenario which I outlined in my post? What happens if Excel is not done saving (which means save_EXcel vi is still working) and the next write to Excel command is invoked? Basically the 1 minute period of the timed loop is not enough for "collecting date, processing date, adding the newly collected data to 5 strip charts, writing to excel and then saving 23 MB file", then repeat all of it. That means even before saving operation is complete the next data may be in queue to be dunmped into Excel. Am not able to understand will I get an exception like the one I have mentioned in mypost.
Thanks.
10-31-2008 05:51 PM
Hi looking at your first graph , you appear to have been running for 52 hrs.How often do you save to disk?
If you are not utilising a buffer then you memory usage will increase with time!
What version of software are you running? Is it Execl 2003 or 2007?
If you look at you vi properties you can see how much memoy is being used on you program.
We can postulate ideas theories etc but you can help yourself by showing your source code. More help will then be forthcoming.
xseadog
10-31-2008 09:21 PM - edited 10-31-2008 09:24 PM
Thanks.
I am attaching the main vi of the application where the main timed loop is located. Hopefully this will help.
Could you please elaborate about buffers?
About the data acquisition freqency : I am acquiring data every minute - and the intentiion is to do it for 250 hours at least.
Thanks.
10-31-2008 10:36 PM
10-31-2008 11:14 PM
Thanks for your inputs. I agree that the code is not very clean. But this the best I could do in whatever time I had to write the code.
Will try to clean it up and will also check whether I am closing all the references. Any advice on checking on memory leaks?
Thanks again.
11-01-2008 12:29 AM
Seems like there are some seriour memory issues in the application.
I was just checking the task manager and when the error occured Labview was taking up about 255 MB of memory. So I closed Labview, restarted my application to see how much memory usage Labview showed at start - it is only about 27 MB. And I was tracking each loop of data acquisition, excel write and save and update strip chart adds about 400 kb to the memory usage.
Can somebody give me pointers to checking memory leaks?
Thanks in advance.
11-01-2008 10:54 AM