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.
The OS treats it (ExitApplication) like a crash and may restart it.
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...