But when you run the code the Map does not exist, ever, until the line that creates it as an empty one.
Normally, for data that is intended to survive between executions of a program, you would load that data on start (or when it was needed).
So I would expect your Map to be loaded first, if it exists.
If it doesn't exist then an empty one would be used instead.
And when having just one instance running in several proceses, I think in using Spring ioc but what when using just Java, maybe Singleton?
If you want multiple running instances to be able to read and write to some persistent resource, why not use a database?