Revert "Revert "Bring back debug.FreeOSMemory() call""

This reverts commit 69538cb7e3.
This commit is contained in:
M. Mert Yildiran 2022-05-02 02:18:45 +03:00
parent 684c51686f
commit d7e22ab788

View File

@ -2,6 +2,7 @@ package tap
import (
"runtime"
_debug "runtime/debug"
"sync"
"time"
@ -47,6 +48,7 @@ func (streamMap *tcpStreamMap) CloseTimedoutTcpStreamChannels() {
for {
<-ticker.C
_debug.FreeOSMemory()
streamMap.streams.Range(func(key interface{}, value interface{}) bool {
// `*tlsStream` is not yet applicable to this routine.
// So, we cast into `(*tcpStream)` and ignore `*tlsStream`