We are in the process of migrating this forum. A new space will be available soon. We are sorry for the inconvenience.

Java problems on vks


mel
10-12-2012, 12:43 PM
Here is another well-written description of the problem and the solution:

https://redmine.personalized-softwar...VZ_Futex_issue

I consider Java to be broken on the KVS. Is OVH doing something to fix the problem? The easiest workaround is to change the way the VPSs are configured (using the cpus and/or cpumask parameters). Longer-term, perhaps OVH can work with the proxmox and/or openvz teams to get the problem fixed in the kernel. Java is just too important a language to not work properly on a VPS.

mel
10-08-2012, 05:49 PM
I cannot run Java reliably on a small Kimsufi vps.
The symptom is that a Java process sometimes hangs and stops responding in any way, including CTRL-C.

Has this problem been reported before, and is there a known workaround/solution?

I have encountered this before on my dedicated Kimsufi server running Proxmox 2.1, where it was easier to reproduce. After searching for the problem on the openvz forum, I found a workaround: Don't limit the number of cpus. Set --cpus 0 on the VPS container. The cpu allocation of the vps can still be controlled using the cpuunits parameter. According to one openvz forum entry, allocating at least 2 CPUs solves the problem: http://forum.openvz.org/index.php?t=msg&goto=43571&

However, now that I rented a VPS from OVH, I don't have this workaround.
I use Java in order to do periodic back-end processing of a web-application's database.

I've managed to reproduce this using a simple ant script and a trivial java file. I use ant to compile the file and build a jar file. Ant uses Java and it adds enough complexity to trigger the problem. It still doesn't happen every time. It typically happens within 5 repetitions.

I use the default Debian 6 installation. I did:
* apt-get update
* apt-get upgrade
* apt-get install openjdk-6-jdk
* I installed ant by downloading it from http://ant.apache.org/ and putting it in my path. (I used ant 1.8.2 specifically).

Here is my test case:
In an empty directory, create two files: src/Stress.java, build.xml
Then run "ant" a few times until it hangs.
------------------------------
src/Stress.java: contains just this line:
------------------------------
Code:
public class Stress{}
------------------------------
build.xml: contains:
------------------------------
Code:
	
	
	
	

	
		
		
		
	

	
		
			
		
	

	
Sometimes there is an hs_err_pid{pid}.log file written in the directory.
I include some lines that look interesting:
Code:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f9c87450af9, pid=21666, tid=140309304641280
#
# JRE version: 6.0_18-b18
# Java VM: OpenJDK 64-Bit Server VM (14.0-b16 mixed mode linux-amd64 )
# Derivative: IcedTea6 1.8.13
# Distribution: Debian GNU/Linux 6.0.4 (squeeze), package 6b18-1.8.13-0+squeeze2
# Problematic frame:
# V  [libjvm.so+0x266af9]
#
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
#   http://icedtea.classpath.org/bugzilla
#
...
Current thread (0x00007f9c48001000):  JavaThread "Finalizer" daemon [_thread_in_vm, id=21676, stack(0x00007f9c4e330000,0x00007f9c4e431000)]

siginfo:si_signo=SIGSEGV: si_errno=0, si_code=128 (), si_addr=0x0000000000000000
...
---------------  S Y S T E M  ---------------

OS:6.0.6

uname:Linux 2.6.32-042stab057.1 #1 SMP Fri Jun 22 02:17:07 MSD 2012 x86_64
libc:glibc 2.11.3 NPTL 2.11.3
rlimit: STACK 8192k, CORE 0k, NPROC infinity, NOFILE 1024, AS infinity
load average:0.16 0.06 0.02

CPU:total 1 (8 cores per cpu, 1 threads per core) family 16 model 2 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, mmxext, 3dnow, 3dnowext, sse4a

Memory: 4k page, physical 524288k(339840k free), swap 131072k(55900k free)

vm_info: OpenJDK 64-Bit Server VM (14.0-b16) for linux-amd64 JRE (1.6.0_18-b18), built on Jun 27 2012 10:26:58 by "jmm" with gcc 4.4.5