04-02-2013 12:28 PM
I have posted this same particular question before and replied to it, but I think it may be locked because I have recieved no response to it. I have been having issues with my memory increasing expodentially and almost instaneously after running for hours and even days without issue. I realize that my architechture is not the best, but I am not a full time labview programmer and the code that I have always used, did work before without fail. The errors and memory issues seem to have appeared ever since the upgrade to Windows 7 64bit, and LV 2011. I have VI's from 2010 that are even more poorly coded than the ones I do now and they run for weeks on end ( which is what our tests require) without an error or memory increase. Can someone please pinpoint what exactly is the cause of this? Is it a bug? Again I know my coding is not pretty, but it did work before.
04-02-2013 12:55 PM
From (very) quickly looking at the code, I'm thinking you should look at your File I/O. You are constantly opening and closing your report file. This could lead to some memory issues. You really should open the file at the start, write as much as you want in the middle, and close the file when you are completely done. Granted, you will need to get away from your express VIs in order to do this properly.
04-02-2013 01:10 PM
A quick trip through the VI Analizer points out a few potential pitfalls
Some of that file handleing needs to get spawned off into a sub.vi and references to files need to get closed!
Most of those True False case structures could be replaced with select functions. I really don't understand the loop with the trigger and gate function and the statistics express vi configured to return total samples when you want the value of index 1. All those dynamic data conversions and express vis are going to bloat memory as well.
04-02-2013 01:36 PM
I was under the impression that the write to measurement only called when the elapsed time (set by user) expired and the case went to recording. When the case is not in the recording state the file should remain open? Should I then wire a True constant to it?
04-02-2013 01:39 PM
The loop with the Trigger and Gate is for counting Prox switch analog signals to count cycles, that loop then takes the cycles and calculates the cycles per minute from the shift registers, it works great, is that one of the issues, because I have been using that piece of code for years on other riggs here and no issues. And what select functions are you refering to for which case structures? Thanks
04-03-2013 07:44 AM
I don't have the VI analyzer, can you tell me what other occurrences it found as potential problems. I moved the concatenate strings outside the while loop, to see if that helps. I keep making adjustments and deleting things I think are an issue and still keep getting an error for samples and the memory skyrockets to 4GB
04-03-2013 09:27 AM - edited 04-03-2013 09:32 AM
Fair enough. (But you should seriously consider an upgrade to your development enviornment!)
The results may not do much for you though without running it local to your vi
[EDIT] Oh, Come ON! I can't attatch a *.txt file????
04-03-2013 01:17 PM
I ran the Profile Performance and Memory tool on the VI while running and set the max bytes to appear. It seems like the Add function that I have numerous times is using a lot of blocks and bytes. I don't think that is the problem but was curious about it. I am in process of writing another program trying to use clusters and in place element structures as much as I can. I am also going to try my hand at event structure architechture with this one. I also did some things to the existing program that I am running like moving the concat strings outside the while, and opening my write to file once and just writing to it whenever the case changes.
04-03-2013 01:50 PM
OK Attachments work again. Lets try again
04-03-2013 01:58 PM
Thanks for that, some useful tips on what I am doing wrong.