add memory limit
This commit is contained in:
15
runner/limiter.go
Normal file
15
runner/limiter.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package runner
|
||||
|
||||
import "os/exec"
|
||||
|
||||
type limiter interface {
|
||||
prepare(cmd *exec.Cmd) error
|
||||
afterStart(cmd *exec.Cmd) error
|
||||
collect() limitStats
|
||||
cleanup()
|
||||
}
|
||||
|
||||
type limitStats struct {
|
||||
PeakMemory int64
|
||||
MemoryExceeded bool
|
||||
}
|
||||
Reference in New Issue
Block a user