LabVIEW as a Service - process stays in memory despite finishing execution

I have a fairly interesting/unique problem with trying to run a LabVIEW built executable as a service using srvstart (http://www.nick.rozanski.org.uk/services). Srvstart allows you run any application as a service (similar to srvany or firedaemon) but it has the advantage that when you shutdown the service, you can set it to send a WM_CLOSE message which can be picked up in LabVIEW using the Application Instance Close? filter event and shutdown the service gracefully without killing it (as is the case with srvany).
To debug this, I put a simple file write into the Application Instance Close? and Panel Close? events, my 'Exit' case and in a sequence structure at the very end of my application. If the application shuts down gracefully, a file will be created for at least the 'Exit' case and the the final file write.
When I run the application in the LabVIEW development environment or as a normal executable (by double clicking on the EXE), it shuts down gracefully (by queueing up an 'Exit' command and executing the 'Exit' case) when I close the front panel (which is just an empty front panel - no controls/indicators as it runs without a UI as a service) - it creates the files and the application closes (and the process in task manager disappears).
When I run the application and try to shut it down by using 'End Task' or run the application as a service. This should fire the Application Instance Close? filter event, which is then discarded (with silent shutdown) which will should queue up an 'Exit' command and shut down the software gracefully.
What actually happens is that If I'm running the EXE normally and I 'End Task', the front panel closes but the application process stays in the system (i.e. in task manager). None of the files are written so the application hasn't gracefully shutdown. I then have to kill the process in task manager.
When I'm running as a service and 'Stop' the service, the files for Application Instance Close?, my 'Exit' case and the last call get created, the memory usage goes from 30to 80mb and the process stays in memory (in task manager) - the service doesn't respond and I have to shut it down via task manager. I call 'Quit LabVIEW' right at the end of my VI, just after the last call file is created, if I disable this, the same thing happens but the memory usage doesn't go up. In both cases though, the service/application doesn't respond.
I have to be a little careful about what I post in terms of VIs/screenshots for IP reasons but I'll try to illustrate my setup:
In terms of other considerations, the VI does some asynchronous calls for handling TCP connections but these will finish execution when the main event queue is destroyed and the problem still occurs even if no TCP connections occur (and hence no calls are made to the asynchronous VI). I'm running LabVIEW 2011 SP1 on a Windows 7 64-bit.
I tried to use the Desktop Trace Execution toolkit to help debug the issue but it seems that the VI Server shuts down and doesn't show me any trace information after I tell the service to Stop.
The things I don't understand are:
- If I 'End Task' on the EXE, shouldn't that fire the Application Instance Close? filter event in LabVIEW? I understand that Windows would give a 'This application is not responding...' message if it then didn't shutdown or if I didn't discard the event but I don't understand why that event isn't being captured/discarded on my EXE.
- Why doesn't the process end when the VI has finished executing - even though I call the 'Quit LabVIEW' VI as the last call in my application?
- Finally, why does the memory usage go from 30mb to 83mb depending on whether or not I call the 'Quit LabVIEW' VI (but the process still stays in Task Manager)?
The key one is the second one - as this is the one that stops me from being able to stop/restart the service from 'Services'. I'd like to be able to use my 'Exit' case to try and send a last ditch 'Hey I'm shutting down now' message before the PC switches off by gracefully shutting down my service (and you know - because it's better to shutdown things in a controlled manner - hence the reason for using srvstart in the first place!)
If anyone can help shed some light on this I'd really appreciate it as I've been trying to debug this for a lot longer than I'd like and despite asking around a few people not been able to come to any sort of solution.
Certified LabVIEW Architect, Certified TestStand Developer
NI Days (and A&DF): 2010, 2011, 2013, 2014
NI Week: 2012, 2014
Knowledgeable in all things Giant Tetris and WebSockets

Since about LabVIEW 8.5 it is a very bad idea to add the Application Close? filter event and expect LabVIEW Quit to still do anything! It simply behaves as No Operation when this filter event is registered in any event structure.
The proper way to handle this is to make the LabVIEW code terminate gracefully (terminate every loop in there) and as last operation close the Front Panel explicitedly with the VI Server method.
LabVIEW Quit is btw. anyhow only a emergency bandaid. It is really analogous to crashing your car in a wall to make it stop. Pretty effective but also dangerous for various reasons. The proper way to terminate a LabVIEW built application is and has always been to make sure every loop has terminated and then close every and any front panel of your application as last measure. An open front panel (even when hidden) will keep your executable alive forever.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • How to run the LabVIEW exe as background process?

    Dear All,
                   I want to run my LabVIEW exe as background process, which wont show as the process in the task bar as shown in the .jpeg file.
                    I want to run it as a background services as like runs in the windows processes.
                    Please suggest me something.
    Thanks,
    Nishant

    Dear Smercurio,
               Thanks for the good one, but it still requires the windows XP or later OS, when i extract the software, it gives me this error.
               Even Fire Daemon software (same one provided by Alessio in this post) is also running the same, and we even dont have to make it Automatic to start at boot up time, it automatically creates the automatic service which also runs at boot time, so not to worry about anything.
    Thanks,
    Nishant
    Message Edited by Nishant on 12-05-2006 10:12 PM
    Message Edited by Nishant on 12-05-2006 10:16 PM
    Attachments:
    rktools error.jpg ‏12 KB
    rktools error.jpg ‏12 KB
    rktools error.jpg ‏12 KB

  • How long does subVI stay in memory

    Hi,
          I would like to know how long does a subvi stay in memory? If it is not used anymore will LabVIEW automatically close it? Thanks!
          Tom
    Solved!
    Go to Solution.

    Overall, we don't have enough information to fully answer the question, because the question is not very specific.
    For example:
    if the subVI is called dynamically, it probably can leave memory once it is closed.
    If the subVI is reentrant, It can have multiple instances in memory.
    To have a subVI in memory is typically irrelevant in terms of the memory the code alone occupies. More serious is the amount of data structures allocated by the subVI. Here we have some tools, e.g. the "request deallocation" primitive. This can be useful if a subVI is called only once, and then never again, but needs gigantic data structures. Typically, subVIs are called multiple times with similar data structures, so it would be a mistake to constantly deallocate, only to reallocate a few nanoseconds later.
    As Smercurio_fc already mentioned, another important question for performance tuning is if the front panel is in memory or not. A subVI that does not need to have the FP in memory executes often much faster and takes less memory. It is thus important not to have the FP of subVIs open unless there is a need for interaction. Certain coding habits (e.g. use of some invoke nodes or some property nodes) also force the FP in memory, even if the FP is not shown. This is documented in the help for each method/property so it is important to avoid these if they are not really needed.
     In summary, it would be interesting to know what exact concerns the OP had when he asked " I would like to know how long does a subvi stay in memory?".
    There has to be more to the question...
    LabVIEW Champion . Do more with less code and in less time .

  • Dereferenced objects are hold by Finalizer and stay in memory forever

    One of my application is running out of memory constantly. I profiled it with jmap/jhat and found that a large growing number of dereferenced com.sun.net.ssl.internal.ssl.SSLSessionImpl objects stay in memory, only referenced by same number of Finalizer objects. These objects are created indirectly by part of the code that frequently calls Apache common-httpclient for another HTTPS service. Full garbage collection can't release them from tenured space, they grows as requests come in and stay in tenured space forever. This issue is very similar to http://forum.java.sun.com/thread.jspa?threadID=346348.
    I tried following things but none of them helped:
    1. Call System.runFinalization();
    2. Increase priority of Finalizer thread;
    3. Try several types of garbage collector: the default serial collector, ParallelOldGC and ConcMarkSweep
    4. Take system out of network and hope finalizer slowly keep up the pace
    5. Increase ParallelGCThread
    6. Increase Eden space and Survivor space and make sure they are rarely full
    If it's not a bug of SSLSessionImpl, is there any way to force to clean up a type of dereferenced objects explicitly and synchronously? Any suggestions for this issue?
    Thanks
    -Jiaqi

    One of my application is running out of memory constantly. I profiled it with jmap/jhat and found that a large growing number of dereferenced com.sun.net.ssl.internal.ssl.SSLSessionImpl objects stay in memory, only referenced by same number of Finalizer objects. These objects are created indirectly by part of the code that frequently calls Apache common-httpclient for another HTTPS service. Full garbage collection can't release them from tenured space, they grows as requests come in and stay in tenured space forever. This issue is very similar to http://forum.java.sun.com/thread.jspa?threadID=346348.
    I tried following things but none of them helped:
    1. Call System.runFinalization();
    2. Increase priority of Finalizer thread;
    3. Try several types of garbage collector: the default serial collector, ParallelOldGC and ConcMarkSweep
    4. Take system out of network and hope finalizer slowly keep up the pace
    5. Increase ParallelGCThread
    6. Increase Eden space and Survivor space and make sure they are rarely full
    If it's not a bug of SSLSessionImpl, is there any way to force to clean up a type of dereferenced objects explicitly and synchronously? Any suggestions for this issue?
    Thanks
    -Jiaqi

  • Does anyone know how to display (in LabVIEW) the memory use during execution of an image and data acquisition VI to predict when it is time to cease the acquisition to prevent the program crashing?

    Does anyone know how to display (in LabVIEW) the memory use during execution of an image and data acquisition VI to predict when it is time to cease the acquisition to prevent the program crashing?
    I am acquiring images and data to a buffer on the edge of the while loop, and am finding that the crashing of the program is unpredictable, but almost always due to a memory saturation when the buffers gets too big.
    I have attached the VI.
    Thanks for the help
    Attachments:
    new_control_and_acquisition_program.vi ‏946 KB

    Take a look at this document that discusses how to monitor IMAQ memory usage:
    http://digital.ni.com/public.nsf/websearch/8C6E405861C60DE786256DB400755957
    Hope this helps -
    Julie

  • Analysis Services Processing Task - Error processing

    Hi all,
    I have a SSIS package containing an Analysis Services Processing Task. In case it fails, I want to insert the error messages in a table. I have create an SSIS package that fails because of dimension values that are not in the fact table. The package fails and
    shows a number of errors in the debug window:
    Error: 0xC1000007 at Create Cube, Analysis Services Execute DDL Task: Erreur interne : L'opération n'a pas abouti.
    Warning: 0x811F0001 at Create Cube, Analysis Services Execute DDL Task: Erreurs dans le moteur de stockage OLAP : 
    Clé d'attribut introuvable lors du traitement de : Table : 'dbo_SSIS_DATA', Colonne : 'PRODCODE', Valeur : 'HUME'. L'attribut est 'PRODCODE'.
    SSIS package "Step 2 - Create Cube.dtsx" finished: Failure.
    However in the error list window there are 0 errors and 0 warnings.
    So, why doesn't it show an error message in the error list when the package clearly fails. And how can I get the error messages from the log into a table? Thanks in advance.
    Hugo

    Error list does not reflect what is getting to be logged, it is more for package validation.
    But the same errors will show up in the status, and the output window.
    Furthermore, if your log is table bound (e.g. the sysssiserrorlog) and in the log config you chose to log the OnError events then these will be captured automatically.
    Arthur
    MyBlog
    Twitter

  • SQL Server 2005 agent job runs a SSIS package ( Analysis Services Processing Task) fails

     Hi,
    SQL Server 2005 standard edition.
     I have a SSIS package which has a  Analysis Services Processing Task. I have tested the package in BIDS and it runs ok. But when I created a agent job and run it from the job it reports error:
    Code: 0xC0012024     Source: Analysis Services Processing Task      Description: The task "Analysis Services Processing Task" cannot run on this edition of Integration Services.
    It requires a higher level edition.
    This is the result of select @@version
    Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86)   Nov 24 2008 13:01:59   Copyright (c) 1988-2005 Microsoft Corporation  Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1) 
    Any idea?

     Hi,
    SQL Server 2005 standard edition.
     I have a SSIS package which has a  Analysis Services Processing Task. I have tested the package in BIDS and it runs ok. But when I created a agent job and run it from the job it reports error:
    Code: 0xC0012024     Source: Analysis Services Processing Task      Description: The task "Analysis Services Processing Task" cannot run on this edition of Integration Services. It
    requires a higher level edition.
    This is the result of select @@version
    Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86)   Nov 24 2008 13:01:59   Copyright (c) 1988-2005 Microsoft Corporation  Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1) 
    Any idea?
    Anyway, I have found a work around:
    http://technet.microsoft.com/en-us/library/ff929186.aspx

  • In service order Issu:No account assignment found for this service process

    Issue:No account assignment found for this service process
    An error has occurred in the system RT1400LS while copying the document
    Message no. CRM_ORDER_MISC 020
    Diagnosis
    Errors have occured while transferring the document into another system. Remove the error messages from the enclosed log.
    Transmission log
    No account assignment found for this service process (Notification E CRM_SRV_LOG_EXT_OLTP 008)
    While we created the service order as a fallow up document of the quotation system unable to create the PR. System showing the above error in the service order.
    We created the service order with same items directly not as fallow up document to quotation PR created with out any fail.
    As per my analyses above error because system unable to find out the Internal order to create the PR hence we created service order as a fallow up document of the service quotation.
    Revert require data to understand the issue more.
    Best Regards,
    Prakesh

     Dear Gurus,
    Thanks for your update. we checked as per your suggestion but the issue is PR is not determining the IO while creating the PR.
    We used the different item cat in quotation and service order system generating the PR, But our Clint want to use the same item cat in the both service order and quotation.
    If we created the quotation after that service order with the service line item and spare part line item system creating the IO (internal order) but PR not generating.
    Please help me in this scenario what should we do.
    Best Regards,
    Prakesh.

  • Error in Deploying the web service process

    Hi all,
    I will working on web service process in ebs server. In this server i had executed the web service process successfully.
    After Restarting my ebs server i checked again the web service process , but it throws following error running the "Asant deploy-war" command.
    Error is :
    The following error occurred while executing this line:
    /p01/oracle/pixcomn/java/oracle/apps/webservice/j2eetutorial15/examples/common/targets.xml:56:
    An exception occurred while running the command. The exception message is: CLI171 Command deploy failed :
    Application hello-jaxrpc is already deployed on other targets. Please use create-application-ref command to create reference to the specified target;
    requested operation cannot be completed.
    Please help how to solve this web service issue.
    Thanks
    Prabu

    Hi Hussein,
    I checked the Server log , i got the followinf log file.
    [#|2012-02-03T13:11:34.993+0530|SEVERE|sun-appserver-pe8.2|javax.enterprise.system.container.web|_ThreadID=10;|WEB0200: Configuration error in web module [hello-jaxrpc] (while initializing virtual server [server])
    com.sun.enterprise.config.ConfigException: I/O error while loading deployment descriptor for: hello-jaxrpc
    cause: The archive null does not contain deployment descriptor file WEB-INF/web.xml
         at com.sun.enterprise.instance.WebModulesManager.getDescriptor(WebModulesManager.java:398)
         at com.sun.enterprise.instance.WebModulesManager.getDescriptor(WebModulesManager.java:343)
         at com.sun.enterprise.web.VirtualServer.loadWebModuleConfig(VirtualServer.java:518)
         at com.sun.enterprise.web.VirtualServer.getWebModules(VirtualServer.java:365)
         at com.sun.enterprise.web.WebContainer.loadWebModules(WebContainer.java:837)
         at com.sun.enterprise.web.WebContainer.start(WebContainer.java:722)
         at com.sun.enterprise.web.PEWebContainer.startInstance(PEWebContainer.java:515)
         at com.sun.enterprise.web.PEWebContainerLifecycle.onStartup(PEWebContainerLifecycle.java:54)
         at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:300)
         at com.sun.enterprise.server.PEMain.run(PEMain.java:294)
         at com.sun.enterprise.server.PEMain.main(PEMain.java:220)
    Caused by: java.io.IOException: The archive null does not contain deployment descriptor file WEB-INF/web.xml
         at com.sun.enterprise.deployment.archivist.Archivist.readStandardDeploymentDescriptor(Archivist.java:233)
         at com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:195)
         at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:131)
         at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:673)
         at com.sun.enterprise.instance.WebModulesManager.getDescriptor(WebModulesManager.java:387)
    Thanks
    Prabu

  • Difference between business activity and service process in transaction

    Hi Friends,
    Can anyone explain me  the difference between business activity and service process in transaction category of service desk
    Thanks & regards,
    Shanmugam Balamurugan

    Hi,
    Activity means e.g.. sales call, customer visit etc.
    But service process means after you sale your product if some service related issue arrives then that is taken care by this transaction.
    Inspire by rewarding.
    Regards,
    Nikhil

  • Does anyone know how to display (in LabVIEW) the memory use during execution of an image and data acquisitio​n VI to predict when it is time to cease the acquisitio​n to prevent the program crashing?

    Does anyone know how to display (in LabVIEW) the memory use during execution of an image and data acquisition VI to predict when it is time to cease the acquisition to prevent the program crashing?
    I am acquiring images and data to a buffer on the edge of the while loop, and am finding that the crashing of the program is unpredictable, but almost always due to a memory saturation when the buffers gets too big.
    I have attached the VI.
    Thanks for the help
    Attachments:
    new_control_and_acquisition_program.vi ‏946 KB

    got these vi's off ni site a while ago - see if they help
    Attachments:
    Memory_Monitor.zip ‏132 KB

  • Service Process Monitor  export to excel is not working

    Hi,
    The  Tx. CRM_SRV_REPORT ( Service -> Service Process Monitor) is not working.
    When you try to export to Excel (press button Excel (CtrlshiftF7) is not working. However, this button in other transaction is working, for example Activity Monitor.
    Any idea?
    Lyda

    Report to SAP. They sent a solution... it's an error

  • On closing Firefox (3.6.15) I finding that although the applicatione ends, the process remains in memory. Any ideas how I can solve this?

    As long as the process remains in memory, Firefox does not restart and if I have any music playing in a site on shut down, the sound continues.
    I can stop the process using task manager and I have twice reinstalled the application without success. In addition there have been times when there is no content in the tools or view menus.

    https://support.mozilla.com/en-US/kb/Firefox%20hangs <br />
    see '''hang-at-exit'''

  • Tax Calculation for Service Process at service entry level

    Hi all ,
    We have Service process where the tax calculation is Purchase Item level and the Tax calcaulation is happening from there .
    and also during MIRO .
    system is not able to determine the tax calculation at service entry level , how can we achieve this ?
    can some help me on this .
    thanks ,
    ksr

    Hi,
    please check additionally the following OSS notes:
    495316     Taxes with services
    See consulting Note 498878 for information about the functioning of    
    taxes for service documents.                                           
    For service orders, you can set in Customizing (Transaction ML100 or the          
    following path: -> Materials Management -> External Services Management           
    -> Taxes at Individual Service Level) whether the taxes are calculated            
    at individual service level or at item level.    
    If you set the 'Taxes at individual service level' indicator for a     
    country, you can maintain tax data (tax indicator MWSKZ and tax        
    jurisdiction code TXJCD) in a purchase order at service level AND at   
    item level in Customizing.                                             
    The tax calculation only occurs at service level.    
    Regards,
    Edit

  • Need a list of all services, processes and servers

    Hi experts,
    i'm totally new to this but i need a list of all services, processes and servers. Is there a easy way to get them?
    I try to create a tool where you are able to virtually shutdown servers and then you can see what happends to the services and processes. Hope someone can help me.
    Thanks
    btw - sorry for my english

    i'm not sure if you all understand what i'm trying to do so i'll ty to explain it
    first i'll try to explain how i understand SOA
    - there are several servers on which the services run
    - a service is only runnable if his server is active
    - a process consists of several services
    - if one of these services isn't runnable anymore the whole process isn't runnable too
    - there are user who use one or more processes
    - if one of the used processes is not able to run the user will be affected
    the tool i'm trying to write should automatically import the descriped information (server-, service-, process- and userlists) from a given SAP-Systemand then you can switch virtually a server to see which services, processes and user would be affected.
    This would be fine if you want to shut down a server for maintance work or something like that.
    so i hope you understand my problem and you are able to help me
    again i want to excuse for my english and my wimpy knowledge about the SOA Architecture of SAP

Maybe you are looking for