Yes, this is what happens when your service is killed. The program is removed from memory, and when it is reloaded into memory, all default values ββfor static variables are accepted. In other words, the bytecode for your program cannot change from execution to execution.
As a rule, it was considered that it is bad to use static variables to maintain state. Try storing them in a repository stored in the repository, like a sqlite database.
source share