LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does my application linger after it is closed?

I have a pretty large (12.5 MB) test application that will hang for like 30 seconds after the user closes it.  It does take a lot of data, but in my exit routine I close all open references, empty arrays, and close all VISA connections.  Why does it hang?
0 Kudos
Message 1 of 4
(2,148 Views)
There could be a number of reasons for this:
  • What kind of references are you closing? Are they ActiveX references? Are you closing them in the reverse order that you opened them?
  • Is the data being displayed on front panels? Emptying out arrays is usually not necessary, as this is done automatically when you quit out of LabVIEW.
  • Do you by any chance have something that's running continuously and has some sort of timeout?
  • Speed of your system.
  • LabVIEW version.
  • Amount of time for the run-time engine itself to unload.
I have a similarly sized app and quitting out of it takes about 10 seconds. It's a test executive, and it doesn't collect a whole lot of data, unless you consider the results table on the front panel, but that usually only has a few hundred rows.
0 Kudos
Message 2 of 4
(2,127 Views)
Thanks for the prompt reply.
 
Okay,
 
1) I am talking about references to controls.  I am not closing them in reverse order.
 
2) Data on the front panel is kinda like a list of tests, each test's associated P/F and the margin.  Nothing too crazy.
 
3) I wrote the top level to be 1 large while loop with a large case structure inside.  The input to the case is int.  The program starts at case -10 and  counts up through the (initialization) cases until it reaches case 0.  Case 0 is the default case that monitors for user interaction like menu selections made and buttons pressed.  Once a selection is made, the software goes to the corresponding case and executes the vi or whatever is in that case, then returns to case 0 again.
 
4) I am using a new PC with 2 GB ram, etc.  It should not be a hw issue.
 
5) I am using labview 8.5.1.
 
6) What do you mean by "Amount of time for the run-time engine itself to unload."
 
Just to clarify, when the user selects the Exit Program button, the front panel goes through it's exiting tasks (I know because it lists them in a status pane), then disappears, however, the application is still present in the Task Manager and in my Windows Taskbar.
 
 
0 Kudos
Message 3 of 4
(2,115 Views)

1) I am talking about references to controls.  I am not closing them in reverse order.
You just need to make sure you close out all the references. Sometimes you get references created and miss them as needing to be closed. E.g., when accessing a property that returns an array of references, but you're only closing the ones you're using.


 6) What do you mean by "Amount of time for the run-time engine itself to unload."
Your application will run within the LabVIEW Run-Time Engine environment. Thus, when you exit out of your program there's an additional wait for the Run-Time Engine to shut down. In my experience it has not taken that long to shut down, though.

Have you monitored the application's resource usage to see if the memory usage increases continously, indicating a potential memory leak?

You may want to try to isolate the problem by seeing if the same thing occurs with a very simple application. Then take your existing application and take out sections at a time to see if this has any effect on the shutdown time.
0 Kudos
Message 4 of 4
(2,091 Views)