From aead6cbc196953d60ff031fb332bc15912e8f28f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Mert=20Y=C4=B1ld=C4=B1ran?= Date: Mon, 2 May 2022 04:13:04 -0700 Subject: [PATCH] Bring back `debug.FreeOSMemory()` call to prevent `OOMKilled`(s) (#1063) * Revert "Revert "Bring back `debug.FreeOSMemory()` call"" This reverts commit 69538cb7e3f4bf5ab0385667bb49acbe41f9a4b2. * Revert "Revert "Revert "Remove `GOGC` environment variable from tapper""" This reverts commit 3d9f37ab4bbb880c0428826877d02d317a0c478f. * Revert "Revert "Revert "Revert "Remove `GOGC` environment variable from tapper"""" This reverts commit 58ff0607ffd7d9ba1a9432355b1f93f68d067866. Co-authored-by: gadotroee <55343099+gadotroee@users.noreply.github.com> --- 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`