add memory limit

This commit is contained in:
2026-04-10 18:45:40 +03:00
parent 86b8d83643
commit a977d4d9f5
13 changed files with 662 additions and 37 deletions

15
runner/limiter.go Normal file
View 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
}