From 1efda8a87e083ed87e031555a36b8573e6ac35aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 14 Apr 2026 15:05:52 +0800 Subject: [PATCH] oom-killer: Record report before reset network --- service/oomkiller/timer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/service/oomkiller/timer.go b/service/oomkiller/timer.go index 6f13d825a..a5bef3a71 100644 --- a/service/oomkiller/timer.go +++ b/service/oomkiller/timer.go @@ -161,6 +161,10 @@ func (t *adaptiveTimer) stop() { } func (t *adaptiveTimer) poll() { + if t.timerConfig.policyMode == policyModeNetworkExtension { + runtimeDebug.FreeOSMemory() + } + var triggered bool var rateTriggered bool sample := readMemorySample(t.policyMode) @@ -205,6 +209,7 @@ func (t *adaptiveTimer) poll() { if !triggered { return } + t.onTriggered(sample.usage) if rateTriggered { if t.killerDisabled { t.logger.Warn("memory growth rate critical (report only), usage: ", byteformats.FormatMemoryBytes(sample.usage), t.logDetails(sample)) @@ -220,7 +225,6 @@ func (t *adaptiveTimer) poll() { t.router.ResetNetwork() } } - t.onTriggered(sample.usage) runtimeDebug.FreeOSMemory() }