JackKirk Well-Known Member Licensed User Longtime User Jun 28, 2016 #1 As part of an exercise to manage out of memory problems I am exploring use of: Code: Copy StartServiceAt("", DateTime.Now + 5000, False) ExitApplication in Starter.Application_Error It seems to work OK except the Time parameter (DateTime.Now + 5000) does not delay restarting the app for 5 secs - restart occurs immediately. Any ideas greatly appreciated...
As part of an exercise to manage out of memory problems I am exploring use of: Code: Copy StartServiceAt("", DateTime.Now + 5000, False) ExitApplication in Starter.Application_Error It seems to work OK except the Time parameter (DateTime.Now + 5000) does not delay restarting the app for 5 secs - restart occurs immediately. Any ideas greatly appreciated...
Erel B4X founder Staff member Licensed User Longtime User Jun 28, 2016 #2 You shouldn't use ExitApplication. It kills the process. The OS treats it like a crash and may restart it. Upvote 0
You shouldn't use ExitApplication. It kills the process. The OS treats it like a crash and may restart it.
JackKirk Well-Known Member Licensed User Longtime User Jun 28, 2016 #3 Erel, When I generate an out of memory error I find that I have to totally eradicate the failing app instance. If I don't then any attempt to resume use of the app results in the failing app instance being resurrected - with its memory still clogged and any attempt to resume use of it ends up with the same problem. So when I trap an out of memory problem I want to totally kill the process and start a new instance. Sounds like ExitApplication may be doing both and the StartService is unnecessary. Erel said: The OS treats it (ExitApplication) like a crash and may restart it. Click to expand... I am a bit worried by the may in the above quote - maybe I should leave the StartService in to ensure the app is restarted? Your comments are eagerly sought... Last edited: Jun 28, 2016 Upvote 0
Erel, When I generate an out of memory error I find that I have to totally eradicate the failing app instance. If I don't then any attempt to resume use of the app results in the failing app instance being resurrected - with its memory still clogged and any attempt to resume use of it ends up with the same problem. So when I trap an out of memory problem I want to totally kill the process and start a new instance. Sounds like ExitApplication may be doing both and the StartService is unnecessary. Erel said: The OS treats it (ExitApplication) like a crash and may restart it. Click to expand... I am a bit worried by the may in the above quote - maybe I should leave the StartService in to ensure the app is restarted? Your comments are eagerly sought...
JackKirk Well-Known Member Licensed User Longtime User Jun 28, 2016 #4 I did a bit more exploration, it appears that the StartService in post #1 is not necessary - but as it does not appear to do any harm I think I will leave it in as insurance for if/when ExitApplication does not cause app to restart. Upvote 0
I did a bit more exploration, it appears that the StartService in post #1 is not necessary - but as it does not appear to do any harm I think I will leave it in as insurance for if/when ExitApplication does not cause app to restart.