From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serious memory issues

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.

0 Kudos
Message 1 of 10
(2,264 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 10
(2,248 Views)

A quick trip through the VI Analizer points out a few potential pitfalls

1!.PNG

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.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 10
(2,238 Views)

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?

0 Kudos
Message 4 of 10
(2,224 Views)

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

0 Kudos
Message 5 of 10
(2,221 Views)

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

0 Kudos
Message 6 of 10
(2,180 Views)

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????


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 10
(2,158 Views)

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.

0 Kudos
Message 8 of 10
(2,138 Views)

OK Attachments work again.  Lets try again


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 10
(2,130 Views)

Thanks for that, some useful tips on what I am doing wrong.

0 Kudos
Message 10 of 10
(2,126 Views)