mirror of
https://github.com/criyle/go-sandbox.git
synced 2025-11-04 14:49:53 +08:00
12 lines
253 B
Go
12 lines
253 B
Go
package ptracer
|
|
|
|
import (
|
|
"fmt"
|
|
"io/ioutil"
|
|
)
|
|
|
|
// clearRefs clears the ru_maxrss counter (/proc/[pid]/clear_refs 5 to clear maxrss)
|
|
func clearRefs(pid int) error {
|
|
return ioutil.WriteFile(fmt.Sprintf("/proc/%d/clear_refs", pid), []byte("5"), 0755)
|
|
}
|