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"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
_debug "runtime/debug"
|
||||||
"runtime/pprof"
|
"runtime/pprof"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -218,6 +219,7 @@ func closeTimedoutTcpStreamChannels() {
|
|||||||
maxNumberOfGoroutines = GetMaxNumberOfGoroutines()
|
maxNumberOfGoroutines = GetMaxNumberOfGoroutines()
|
||||||
TcpStreamChannelTimeoutMs := GetTcpChannelTimeoutMs()
|
TcpStreamChannelTimeoutMs := GetTcpChannelTimeoutMs()
|
||||||
for {
|
for {
|
||||||
|
_debug.FreeOSMemory()
|
||||||
time.Sleep(10 * time.Millisecond)
|
time.Sleep(10 * time.Millisecond)
|
||||||
streams.Range(func(key interface{}, value interface{}) bool {
|
streams.Range(func(key interface{}, value interface{}) bool {
|
||||||
streamWrapper := value.(*tcpStreamWrapper)
|
streamWrapper := value.(*tcpStreamWrapper)
|
||||||
|
Loading…
Reference in New Issue
Block a user