Giter Site home page Giter Site logo

Comments (10)

daveagp avatar daveagp commented on August 29, 2024

Can you try adding -Xmx1000m after /java/bin/java?

Do putting in the same numbers always cause the same errors even if you repeat them?

from java_jail.

susobhang70 avatar susobhang70 commented on August 29, 2024

Tried with -Xmx1000m

/home/ssad1/safeexec/safeexec --chroot_dir . --exec_dir / --share_newnet --nproc 50 --mem 5000000 --nfile 30 --env_vars CLASSPATH=/cp/:./cp/javax.json-1.0.jar:/java/lib/tools.jar --exec /java/bin/java -Xmx1000m traceprinter.InMemory < cp/traceprinter/test-input.txt

Exception in thread "event-handler" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:714)
at traceprinter.JSONTracingThread.handleEvent(JSONTracingThread.java:221)
at traceprinter.JSONTracingThread.run(JSONTracingThread.java:136)
OK
elapsed time: 2 seconds
memory usage: 4071456 kbytes
cpu usage: 1.577 seconds

As for trying again with the same numbers, I tried all of them again. Everyone produced the same error, except 5000000 printed the log file on the screen itself (said it can't write to log file so dumping to screen). The output is too big and I cannot attach it here it seems (write permission to repo error).

Another observation: every log file present in java_jail is empty.

from java_jail.

daveagp avatar daveagp commented on August 29, 2024

You can also try increasing the "Xmx512M" inside of InMemory.java. I know it's annoying to have three parameters to tweak, but the --mem one being gigantic (30 million k = 30 g) should make that one a non-issue.

from java_jail.

susobhang70 avatar susobhang70 commented on August 29, 2024

I tweaked Xmx512M to Xmx1024M, Xmx2048M, and Xmx4096M. Same result. I had set --mem as 30000000. Here is what I got:

Exception in thread "event-handler" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:714)
at traceprinter.JSONTracingThread.handleEvent(JSONTracingThread.java:221)
at traceprinter.JSONTracingThread.run(JSONTracingThread.java:136)
OK
elapsed time: 1 seconds
memory usage: 5092532 kbytes
cpu usage: 1.523 seconds

from java_jail.

susobhang70 avatar susobhang70 commented on August 29, 2024

Update: I increased nproc to 100 and mem as 30000000. Got proper output. Even with Xmx512M. But error while running on front end.
screenshot from 2015-11-07 15 32 08

from java_jail.

daveagp avatar daveagp commented on August 29, 2024

Put all of the values you discovered worked into jv-config.json (safeexec_mem_k, Xmx)
Add
"safeexec_args" : {"nproc" : "100"}
to set the nproc.

from java_jail.

susobhang70 avatar susobhang70 commented on August 29, 2024

Thank you for everything. 👍

My team is also trying to integrate this with a offline visual debugger called Jeliot, and planning to launch it via JNLP from this site itself.

I'm making changes to the front end, adding save code functionality, and changing the look. I'm attaching a screenshot of the same. Hope you like it :)

screenshot from 2015-11-08 20 55 16

from java_jail.

daveagp avatar daveagp commented on August 29, 2024

Looks great! If you get it working with Jeliot, let me know, that would be very interesting.

from java_jail.

susobhang70 avatar susobhang70 commented on August 29, 2024

This is how it looks now. I've added a Save Code button and a Start with Jeliot button, which actually launches jeliot with this code. The written code is saved in the server and a corresponding JNLP file is generated to launch Jeliot on the client side (user still has to launch the JNLP file). I've been working on it's Moodle plugin for a month now, and managed to fix the bugs for the newer Moodle versions, and applied the same technique to achieve this mechanism.

My initial plans were to also integrate your debugger to Moodle, but unfortunately neither me nor my team have much time to achieve that functionality.

screenshot from 2015-11-10 02 02 07

from java_jail.

daveagp avatar daveagp commented on August 29, 2024

Looks nice, keep up the good work!

from java_jail.

Related Issues (9)

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.