From d7e22ab788b7a8ed3bd5a5dc80c21bd22c37a8b9 Mon Sep 17 00:00:00 2001 From: "M. Mert Yildiran" Date: Mon, 2 May 2022 02:18:45 +0300 Subject: [PATCH] Revert "Revert "Bring back `debug.FreeOSMemory()` call"" This reverts commit 69538cb7e3f4bf5ab0385667bb49acbe41f9a4b2. --- tap/tcp_streams_map.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tap/tcp_streams_map.go b/tap/tcp_streams_map.go index 523a06f2a..9133b46c3 100644 --- a/tap/tcp_streams_map.go +++ b/tap/tcp_streams_map.go @@ -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`