locked
Windows Metro App Terminated by OS

    Question

  • I'm developing a Windows 8.1 App with Html/JavaScript. The app is for my company and I can't say what it does, but the app is bussiness critical. In some scenario our machines can reach 90% of RAM usage and the App is terminated by the OS. I've watched that other Apps are terminated as well, except Microsoft Apps like Skype, Lync etc, they don't get terminated only Suspended. My question is how can I make my app so that the OS can't terminate it?

    Thursday, February 05, 2015 4:27 PM

Answers

  • What are you trying to achieve by preventing the app from being terminated? Why does that matter? Why do you think that would block a business app?

    It sounds like you have an XY problem here. What is the actual problem you are trying to solve? Not terminating the app is not the solution, but we cannot help you if you don't explain what the actual scenario is.

    Whether a properly written app suspends and resumes or suspends, terminates, and restarts is almost completely transparent to the user (the only difference is the terminated app takes a bit longer to restart and shows its splash screen).

    As I said previously, Skype and Lync are real time communication apps. There is no Skype or Lync specific magic.

    Friday, February 06, 2015 3:55 PM
    Owner
  • You should read the documentation links that we've already provided.  You can do this if your app does the same thing as Skype, Lync, or plays background audio.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, February 09, 2015 2:37 PM
    Moderator

All replies

  • If your app goes into the background, it's going to get terminated as resources are needed by the OS. Please see https://msdn.microsoft.com/en-us/library/windows/apps/hh464925.aspx for more information.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, February 05, 2015 8:01 PM
    Moderator
  • Why do you need this and what exactly do you mean? Do you mean that you want the app not to get suspended so it can continue background processing or is suspension ok but you don't want it to terminate?

    You app shouldn't care if it gets terminated after it is suspended. It should persist enough information to get back to the same state it was in before suspension, and this should end up fairly transparent to the user.

    Skype and Lync have slightly different behaviour because of their background communications capabilities, but this isn't something that would be helpful or necessary for general purpose apps.

    --Rob

    Thursday, February 05, 2015 8:27 PM
    Owner
  • Hello Rob,

    I don't want the App to be terminated.
    I've done a litle test with a Console Application that uses a lot of RAM so that my Computer goes about 90% of RAM usage and I've watched in Task Manager what happens to Apps, the first that are Terminated are Non Microsoft Apps, Skype goes only to Suspending, and never gets Terminated. 
    If there are no ways to make App Non Terminated how are there business Apps? Why is Skype not getting Terminated in 95% of RAM usage and other Apps get Terminated in 86-7%.
    Or maybe Microsoft just got some sort of check if (App.Name != Skype && App.Name != Lync) terminated(); 
    • Edited by kaloyanlom Friday, February 06, 2015 8:21 AM
    Friday, February 06, 2015 8:19 AM
  • You still haven't explained why it even matters if your app terminates.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, February 06, 2015 3:43 PM
    Moderator
  • What are you trying to achieve by preventing the app from being terminated? Why does that matter? Why do you think that would block a business app?

    It sounds like you have an XY problem here. What is the actual problem you are trying to solve? Not terminating the app is not the solution, but we cannot help you if you don't explain what the actual scenario is.

    Whether a properly written app suspends and resumes or suspends, terminates, and restarts is almost completely transparent to the user (the only difference is the terminated app takes a bit longer to restart and shows its splash screen).

    As I said previously, Skype and Lync are real time communication apps. There is no Skype or Lync specific magic.

    Friday, February 06, 2015 3:55 PM
    Owner
  • Hello,

    the App is for my company and it is Time Trackin App we are a Softwate company developing SharePoint solutions. We use Hyper-V for virtual machines and as you know SharePoint is very resource expensive.
    When a user starts 1 or 2 virtual machines the RAM of the Host machine goes above 90% RAM and terminateds the TimeTracking App. The App is very simple it gets Work Items from SharePoint list via CSOM and show them to the user, the user can Start timer for a given Work Item, Report it To SharePoint change DuePerson, change Status and so on. The app is monitoring when the user is present and away with Background Task, if the user is away and timer was started the app stops the timer, when the user comes back the app automaticly starts the timer. The problem is that when the app is terminated i have to manualy override the timer couse after app is terminated on the next Start of the App it renders the HTML like new. The App has no pages, no navigation, it's a HUB App with only one page and many Sections. (Sorry for the bad english). 
    I've tested that Skype is not being terminated and i want to make my App the same so I don't have to manage manualy the time of a working Work Item after app is being terminated.
    Monday, February 09, 2015 8:54 AM
  • You should read the documentation links that we've already provided.  You can do this if your app does the same thing as Skype, Lync, or plays background audio.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, February 09, 2015 2:37 PM
    Moderator