mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-22 02:15:56 +00:00
Fix the OOMKilled error by calling debug.FreeOSMemory
periodically
This commit is contained in:
parent
d5b01347df
commit
fba8e5016d
@ -18,6 +18,7 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"runtime"
|
||||
_debug "runtime/debug"
|
||||
"runtime/pprof"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -218,6 +219,7 @@ func closeTimedoutTcpStreamChannels() {
|
||||
maxNumberOfGoroutines = GetMaxNumberOfGoroutines()
|
||||
TcpStreamChannelTimeoutMs := GetTcpChannelTimeoutMs()
|
||||
for {
|
||||
_debug.FreeOSMemory()
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
streams.Range(func(key interface{}, value interface{}) bool {
|
||||
streamWrapper := value.(*tcpStreamWrapper)
|
||||
|
Loading…
Reference in New Issue
Block a user