Closed e-nikolaev closed 1 year ago
Function receiveReplyInternal uses 2 control timers: timeoutTimer and slowTimer.
timeoutTimer
slowTimer
Need to stop these timers before exit from the function (using defer) to avoid memory leak:
timeoutTimer := time.NewTimer(timeout) slowTimer := time.NewTimer(slowReplyDur) defer func() { timeoutTimer.Stop() slowTimer.Stop() }()
I met the problem in our production environment while using very repeatetive dumping IP routes. My temp solution fixed the memory leak.
Function receiveReplyInternal uses 2 control timers:
timeoutTimer
andslowTimer
.Need to stop these timers before exit from the function (using defer) to avoid memory leak:
I met the problem in our production environment while using very repeatetive dumping IP routes. My temp solution fixed the memory leak.