Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

AF exe doesn't leave memory when exiting

By all accounts my built application seems to have exited normally, however it still shows in the Task Manager and I have to kill the process in order to run it again.

I have a top level app controller actor that launches two other actors: 1) Application UI and 2) H/W controller.

When the user hits the Exit button in the UI, the event handler sends a normal stop message to the top level actor. In Stop Core of the top level actor, this causes a normal stop message to both the UI and the H/W controller actors. In the UI actor, when the parent Actor Core terminates, the code then uses a value(signaling) event to exit the user event structure. The  H/W controller is simply a placeholder and so only contains a call to the parent Actor Core method. The top level actor then calls the LabVIEW Exit VI. All three actors are reaching the end of the code as evidenced by message dialogs placed at the end of the data flow.

This works fine in development mode (except I don't call the LabVIEW Exit).

What am I missing here?

0 Kudos
Message 1 of 12
(11,717 Views)

Do your LVLIB's get locked when run in the development environment, but not unlocked like they should when the program finishes?

0 Kudos
Message 2 of 12
(4,666 Views)

You might want to put in a little wait of half a second or so before calling the exit LabVIEW VI. It gives the actors enough time to shutdown.

0 Kudos
Message 3 of 12
(4,666 Views)

Yes to seeing the lock/unlock on the lvlibs when running in development as expected.

Adding a delay before the Quit LabVIEW VI does not work.

0 Kudos
Message 4 of 12
(4,666 Views)

I assume you are reffering to the Quit LabVIEW function?

This function is pretty powerfull from what I've experienced. Nothing escapes from it as far as I know. If you ever have doubt about exiting LabVIEW, this function does the trick 100% of the time. I would investigate to make sure you are actually hitting the quit function in your code and not sitting somewhere else.

0 Kudos
Message 5 of 12
(4,666 Views)

I'm definitely hitting the Quit function...I've got a message dialog immediately in front of it that pops up.

top level actor.png

Then I took out calling the nested actors and just send a Normal Stop to the top level actor, get the message dialog that it's quitting, answer OK...and the app is STILL stuck in the Task Manager.

top level actor2.png

0 Kudos
Message 6 of 12
(4,666 Views)

Problem was two things:

  1. The App UI actor was hiding its window before exiting rather than closing its window.
  2. I had to remove the Quit LabVIEW call in the top level actor.

If either of the above conditions was true (hiding the window or calling Quit LabVIEW), the app remains in memory.

0 Kudos
Message 7 of 12
(4,666 Views)

Is there any followup to why the Quit LabVIEW function sometimes fails to blast an actor framework exe out of memory?  For an exe, I don't really feel like thinking about what front panels are open when I just force a quit (although I am not against the idea if that's the only solution for now)

Even though BillMe is okay where he's at, I'd like to continue this for my own selfish sake.

I'm very interested in the answer for a couple reasons:

  1. Pure curiosity.  It seems odd to me that it doesn't really quit and leave memory on some AF executables, because like Dr. VIshots I've always found that function to be very unambiguous and fast in what it does.
  2. The app/project has reached the point where it's getting embarassing to tell people that they have to force-quit the app.  Didn't mind it so much doing it myself until I could figure it out, but this is going into testing involving others.

I'm also wondering if this is related to why all of my LVLIB's and classes do not unlock when I stop my program in LV IDE.  If I want to modify a class definition or add/remove/rename after that, I have to close my project. 

I had not actually posted on either of my issues because I thought it was something peculiar that I'd done to my project, especially because I was a total rookie when I started this so may have done something weird.  I should mention that all actors appear to shut down just fine, judging by their front panels.  Back when I had a message queue backup problem, an actor still processing would wait to shut down while processing, and you could watch it finally finish and see the run arrow go back to idle, so I don't think that's the problem.  Also, I can run this any number of times in the IDE without issue.

0 Kudos
Message 8 of 12
(4,666 Views)

Ben_Phillips wrote:

Is there any followup to why the Quit LabVIEW function sometimes fails to blast an actor framework exe out of memory? 

Yes.

A) The bug is that the Quit LV function does not work when called from a VI launched through Asynchronous Call By Reference. That means if it is called from any Actor Core.vi or its subVIs.

B) This bug should be fixed in the current beta of LV 2013. To test it, visit http://ni.com/beta to sign up for the beta program and (if approved) download the software.

0 Kudos
Message 9 of 12
(4,666 Views)

Well that's good to know for my LV2011 AF application. I had planned to create a launcher VI that closes itself after launching the top-level UI actor so the app doesn't show two tiles in the Windows Taskbar. Is there a way to accomplish this and still be able to make the EXE exit when the app stops running?

0 Kudos
Message 10 of 12
(4,666 Views)