add nil check
This commit is contained in:
2
utils.go
2
utils.go
@@ -879,7 +879,7 @@ func pollMemoryUsage(pid int, interval time.Duration, done chan bool, peakMem *i
|
|||||||
}
|
}
|
||||||
|
|
||||||
totalMemory := totalRSS + totalSwap
|
totalMemory := totalRSS + totalSwap
|
||||||
if totalMemory > *peakMem {
|
if peakMem == nil || totalMemory > *peakMem {
|
||||||
peakMem = &totalMemory
|
peakMem = &totalMemory
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user