Dear Sir,

Thanks for your reply!

-- Now, I install success cgroup, and I also can use 4 judgedaemons in my server.

-- I also try your suggest about chroot, I follow this link: https://github.com/dozzie/yumbootstrap and install yumbootstrap. After that, I also install chroot with: 

# CHROOT=/mnt/chroot/centos-6-chroot
# /usr/sbin/yumbootstrap --verbose --no-scripts centos-6 $CHROOT
# yum --installroot=$CHROOT -c $CHROOT/yumbootstrap/yum.conf install gcc gcc-c++ jdk...
# /usr/sbin/yumbootstrap --verbose --just-scripts $CHROOT
-- I try to install JDK on chroot, but in my server, I install JDK with alternative command, so I don't know how to install it on chroot.
-- Then, I edit file /judgehost/lib/judge/chroot-startstop.sh with: CHROOTORIGINAL='/mnt/chroot/domjudge'. Then I run /judgehost/lib/judge/chroot-startstop.sh start

-- Final, I run judgedaemons (4 judgedaemon), I try submitting C code => it's CORRECT. Then, I try submitting Java code => it's outpur: 
                                Info: using 'main' from 'Main'

-- I also try disabling chroot in /domjudge/etc/judgehost-config.php , but Java is also output: Info: using 'main' from 'Main'

Can you help me to solve this problem?

Best regard,

Linh

On Fri, Dec 11, 2015 at 7:43 PM, Tobias Werth <werth@cs.fau.de> wrote:
Hi,

*Vũ Linh Nguyễn <linhnv2110@gmail.com> [15/12/10]:
> -- Problem 1: I install JDK 8u66 x64 on my server, and I check javac, java is
> OK, I compiled an example file (hello.java in domjudge/doc/exaples) is OK. But
> when I submit file in domjudge, judgedaemon run OK, but I receive error with
> output:
>
>
> Compiling failed with exitcode 1, compiler output:
> Error occurred during initialization of VM
> Could not allocate metaspace: 1073741824 bytes

You have to increase the value of MEMRESERVED in the java compile
script. It may be necessary that you increase the global memory limit if
that's too small. With 64 bit java, it's very difficult to setup without
cgroups. Last time, I checked, I had to use 1.3GB for MEMRESERVED with a
total memory limit of 2GB to make it work.
But I strongly recommend using cgroups.


> --> I don't know what I wrong, I read your Document, and I found out that about
> chroot, so I disable chroot, then I restart judgedaemon, but it's still not
> working, I can submit Java file (C, C++ is OK).
>
> -- Problem 2: I want to use cgroup, I installed libcgroup-devel. But I don't
> know what is this: 
>
>   • Edit grub config to add memory cgroup and swap accounting to the boot
>     options. Edit /etc/default/grub and change the default commandline
>     to GRUB_CMDLINE_LINUX_DEFAULT="quiet cgroup_enable=memory swapaccount=1".
>     Then run update-grub and reboot.
> --> I can't find out /etc/default/grub => I am using CentOS.

Yes, that documentation is a bit debian specific. You have to find out
how to change the kernel command line options on CentOS. As a starting
point read this:
http://serverfault.com/questions/405558/how-do-i-set-the-default-kernel-parameters-in-centos-for-all-existing-and-future


> -- Problem 3: I want to install chroot. But when I run bin/dj_make_chroot =>
> it's error: Error: No installation directory given.
> Then I run: bin/dj_make_chroot /home/domjudge/judgehost/chroot amd64, I get
> notification about install a package (debootstrap), but I get error when
> install (because this is a Debian package, not for CentOS).
>
> Please help me, thanks for your support!

Again, the documentation is a debian specific. However, it does not
really matter, how you create the chroot. So look for other alternatives
like https://github.com/dozzie/yumbootstrap

Make sure that you install the same java packages inside and outside of
the chroot.

Cheers,
Tobi




--
---------------------------------------------------------------------------------------------
Nguyễn Vũ Linh - Sói Hoang

Software/Website/Game Developer - AI, PTS, Corel, AE Designer
......................
Phone: 0963.203.813
.............................