SymptomsJava applications are crashing, hanging or unable to start properly inside a container, e.g. Tomcat server, Minecraft server and others.
CauseMost likely the issue is caused by cpus limit set to 1 and as the result /proc/cpuinfo shows only one CPU. Under certain circumstances it leads to incorrect JVM functioning or crashes.
ResolutionSet cpus limit to 2 or greater.
vzctl set CTID --save --cpus 2
If you want a container to consume not more CPU power than 1 CPU core set cpulimit to 100% as well:
vzctl set CTID --save --cpus 2 --cpulimit 100