Fix the restart command sometimes deadlocking the server
Prevent Unbounded IntCache Growth

Based on work by Peter Lawrey, this commit prevents unbounded growth of the integer cache and instead caps it to a value specified in the configuration (1024 by default). Should prevent thrashing, especially around world generation.
Upstream merge