Skip to content

Commit fdfb660

Browse files
committed
don't fail getting RSS if process has already exited
1 parent cb4937a commit fdfb660

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

internal/ptree/ptree.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ var (
2424
func GetProcessRSSAnon(pid int) (uint64, error) {
2525
status := fmt.Sprintf("%d/status", pid)
2626
f, err := procfs.Open(status)
27+
if os.IsNotExist(err) {
28+
// process is already gone
29+
return 0, nil
30+
}
2731
if err != nil {
2832
return 0, err
2933
}

0 commit comments

Comments
 (0)