S Stern0m1 Member Licensed User Feb 8, 2017 #1 Do services get killed by the os or does processes get killed by the os? Does the os sometimes clear the memory being used by one service of an app and let another live? Im slightly confused with all the terminology... Im trying to understand if variables declared in the starter service will stay around for other services to access or there is a chance that the memory being used for those variables will be cleared when the starter service gets killed.
Do services get killed by the os or does processes get killed by the os? Does the os sometimes clear the memory being used by one service of an app and let another live? Im slightly confused with all the terminology... Im trying to understand if variables declared in the starter service will stay around for other services to access or there is a chance that the memory being used for those variables will be cleared when the starter service gets killed.
Erel B4X founder Staff member Licensed User Longtime User Feb 9, 2017 #2 Stern0m1 said: Do services get killed by the os or does processes get killed by the os? Does the os sometimes clear the memory being used by one service of an app and let another live? Click to expand... The OS will never kill a service without killing the whole process. Services can be destroyed by calling StopService. Stern0m1 said: Im trying to understand if variables declared in the starter service will stay around for other services to access or there is a chance that the memory being used for those variables will be cleared when the starter service gets killed. Click to expand... The variables will be kept alive. As a general rule all public global objects should be declared in the Starter service and initialized in Service_Create. Upvote 0
Stern0m1 said: Do services get killed by the os or does processes get killed by the os? Does the os sometimes clear the memory being used by one service of an app and let another live? Click to expand... The OS will never kill a service without killing the whole process. Services can be destroyed by calling StopService. Stern0m1 said: Im trying to understand if variables declared in the starter service will stay around for other services to access or there is a chance that the memory being used for those variables will be cleared when the starter service gets killed. Click to expand... The variables will be kept alive. As a general rule all public global objects should be declared in the Starter service and initialized in Service_Create.