Comments (4)
This is a great idea. I've looked into it a bit, and it seems fairly straightforward on Windows, as expected. Unix will be more complicated but should be possible too.
However, I should point out that a programming judge would likely need a separate environment for user programs. There will always be a way to circumvent limits from this crate, potentially allowing programs to damage the system. This crate is mostly intended for trusted programs that might unintentionally exceed their limits, such as code run by test harnesses. Does that still work for your use case?
from process_control.
Yes, it does still work for my use case
I have mentioned the example of the virtual judge to get the idea across, but I am also running and monitoring a reliable process, which in the worst case can exceed the defined memory limits.
I think that feature can be useful in many other use cases.
from process_control.
I think that feature can be useful in many other use cases.
I agree. This has been implemented in version 3.2.0 and will be released tomorrow. The API doesn't exactly match the one in this issue, since it resembles the syscalls offered by supported platforms. They cause allocation to fail if the memory usage would be above the memory limit.
Also, MacOS isn't currently supported, since it doesn't offer syscalls for limiting memory usage.
from process_control.
Version 3.2.0 has been released with Control::memory_limit
, so I'm closing this issue. Let me know if you have any issues.
from process_control.
Related Issues (9)
- Doesn't compile on Illumos HOT 7
- openbsd does not have a waitid system call and should use wait4 instead HOT 2
- Release a new version for windows-sys 0.42 HOT 1
- [FEATURE] CPU limit HOT 2
- Fails to compile on OpenBSD HOT 8
- Fails to compile - error[E0599]: no method named `si_status` found for struct `siginfo_t` HOT 6
- Bump libc dependency to 0.2.98 HOT 4
- build for Android failed HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from process_control.