07-08-2014 02:49 PM
I have a program in labview 2012, it has many dio writes and reads...it creates the task each time and sets the auto cleanup to true and does not clear the task after it has executed. This is a large program and calls these writes and reads many times. I noticed that as the program is in use the CPU performance monitor shows an significant increase in the # of handles and threads and the ram used goes up to, the handles and threads seem to continuously increasing over time. I have multiple intermittent problems that occur more often, the longer the program is running. Eventhough the auto cleanup is set to true I put a wait until done and a clear at the end of each dio read/write, my CPU performance is significantly different now where the # of handles and threads is much lower and does not increase over time, is there some bug in labview? Because it sure looks like the auto cleanup is not working
07-08-2014 09:43 PM
The lesson here is close references and tasks you open and don't depend on automatic closing of this, that, or-the-other-thing. It's a discipline you need to develop.
Always cleanup after yourself.
Mike...
07-09-2014 04:03 AM
Thank you for your response. I normally do cleanu after myself but in this case I am trying debug someone elses code
11-18-2015 11:03 AM - edited 11-18-2015 11:05 AM
Another lesson would be that snarky responses are best left not said...this is a discipline that you need to develop
11-18-2015 11:27 AM
I didn't think mike's response was snarky - it was good programming practice, regardless of who wrote the code. You/they should create the task once at the start of the application and clear the task once at the end. Repeatedly opening/closing the task will cause LabVIEW to repeatedly reserve, configure & release the hardware which is going to use CPU and if any references get left open, they will consume memory.
I'm not certain, but I think the 'auto cleanup' just releases the device once the whole VI finishes executing, if there are no other open references to it at the time.