Tomcat on OpenVZ Vserver/PVS and Ubuntu
tldr;
Works with an older kernel, doesn’t work with 2.6.32. Need to set cpu affinity on the openvz instance.
I got non-starting Tomcats and sometimes errors like this on openVZ vservers:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (nmethod.cpp:2175), pid=2165, tid=3066727232
# guarantee(nm->_lock_count >= 0) failed: unmatched nmethod lock/unlock
#
# JRE version: 6.0_33-b03
# Java VM: Java HotSpot(TM) Client VM (20.8-b03 mixed mode linux-x86 )
# An error report file with more information is saved as:
# /usr/local/apache-tomcat-7.0.28/hs_err_pid2165.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
There are other notes on problems like this on the internet. Happens with Oracle and OpenJDK. Funny thing is it’s working for me on a 2.6.18!
Edit: I cannot test this but setting cpu affinity seems to solve the problem:
https://redmine.personalized-software.ie/projects/opensource/wiki/Java_openVZ_Futex_issue
Btw: I had to upgrade shorewall on ubuntu 10.04 – shorewall version 4.4.6 does not switch of mangling even if it detects that the running kernel doesn’t have the module.
MANGLE_ENABLED=No is a good idea for OpenVZ servers.