Coder Social home page Coder Social logo

关于setrlimit about judger HOT 2 OPEN

qingdaou avatar qingdaou commented on August 18, 2024
关于setrlimit

from judger.

Comments (2)

kidting avatar kidting commented on August 18, 2024

另外想请教一下,我用judger跑一个go程序测试,首先不做限制,judger给出其memory值假设为X,之后我将10 * X作为--max_memory参数,由于memory限制go程序跑不起来,想问问为什么setrlimit设置的资源限制和wait4统计的资源有这么大差异呢?另外同样的测试在C/C++程序上是没问题的

from judger.

virusdefender avatar virusdefender commented on August 18, 2024
  1. 为了避免代码是正确的,但是因为超过内存 oom 而被判定为 re。如果程序占用低于两倍,最后再重新检查内存占用和配置的关系,就可以判定为超内存而不是 re,如果超过两倍,那就真的 re 了(可能会被 kill)。

  2. 对于 go / Java 等带虚拟机的高级一些的语言,因为它们会根据物理内存来预先分配内存而无法感知到存在内存限制,导致分配失败(Java 新版可以感知到 cgroup,但是这里并没用这个技术)。直接限制就会导致一些无法启动的问题。
    建议使用 memory_limit_check_only,也就是不实际进行内存限制,而是只看最终内存使用的数字来判定结果,和问题 1 也有些关系。

from judger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.