diff --git a/utils.go b/utils.go index 1995971..292b89e 100644 --- a/utils.go +++ b/utils.go @@ -879,7 +879,7 @@ func pollMemoryUsage(pid int, interval time.Duration, done chan bool, peakMem *i } totalMemory := totalRSS + totalSwap - if totalMemory > *peakMem { + if peakMem == nil || totalMemory > *peakMem { peakMem = &totalMemory }