From cee8831690edc0bfd9770cdafba7e80753c66bf6 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Fri, 23 Mar 2018 18:32:54 +0800 Subject: [PATCH] support memory_limit_check_only update Java version to 8 --- Dockerfile | 2 +- client/Python/languages.py | 5 +++-- server/judge_client.py | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d782043..85c875d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ COPY build/java_policy /etc RUN buildDeps='software-properties-common git libtool cmake python-dev python3-pip python-pip libseccomp-dev' && \ apt-get update && apt-get install -y python python3.5 python-pkg-resources python3-pkg-resources gcc g++ $buildDeps && \ - add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-7-jdk && \ + add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk && \ pip3 install --no-cache-dir psutil gunicorn flask requests && \ cd /tmp && git clone -b newnew --depth 1 https://github.com/QingdaoU/Judger && cd Judger && \ mkdir build && cd build && cmake .. && make && make install && cd ../bindings/Python && python3 setup.py install && \ diff --git a/client/Python/languages.py b/client/Python/languages.py index bbe8a45..58a0410 100644 --- a/client/Python/languages.py +++ b/client/Python/languages.py @@ -62,9 +62,10 @@ java_lang_config = { "compile_command": "/usr/bin/javac {src_path} -d {exe_dir} -encoding UTF8" }, "run": { - "command": "/usr/bin/java -cp {exe_dir} -Xss1M -XX:MaxPermSize=16M -XX:PermSize=8M -Xms16M -Xmx{max_memory}k -Djava.security.manager -Dfile.encoding=UTF-8 -Djava.security.policy==/etc/java_policy -Djava.awt.headless=true Main", + "command": "/usr/bin/java -cp {exe_dir} -XX:MaxRAM={max_memory}k -Djava.security.manager -Dfile.encoding=UTF-8 -Djava.security.policy==/etc/java_policy -Djava.awt.headless=true Main", "seccomp_rule": None, - "env": ["MALLOC_ARENA_MAX=1"] + default_env + "env": default_env, + "memory_limit_check_only": 1 } } diff --git a/server/judge_client.py b/server/judge_client.py index f43b18a..758dc98 100644 --- a/server/judge_client.py +++ b/server/judge_client.py @@ -114,7 +114,8 @@ class JudgeClient(object): log_path=JUDGER_RUN_LOG_PATH, seccomp_rule_name=self._run_config["seccomp_rule"], uid=RUN_USER_UID, - gid=RUN_GROUP_GID) + gid=RUN_GROUP_GID, + memory_limit_check_only=self._run_config.get("memory_limit_check_only", 0)) run_result["test_case"] = test_case_file_id # if progress exited normally, then we should check output result