From 430bf34dfb056b525bbc504a284399d4e9f5110c Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 26 Jan 2023 01:33:21 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=94=B9=E8=BF=9B=E5=86=85=E6=A0=B8?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=B0=83=E5=BA=A6=E6=9C=BA=E5=88=B6=E6=8F=90?= =?UTF-8?q?=E5=8D=87=E7=A8=B3=E5=AE=9A=E6=80=A7=20https://github.com/siyua?= =?UTF-8?q?n-note/siyuan/issues/7113?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/sql/queue.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/sql/queue.go b/kernel/sql/queue.go index 88bffb347..1b8e5f6db 100644 --- a/kernel/sql/queue.go +++ b/kernel/sql/queue.go @@ -21,6 +21,7 @@ import ( "errors" "fmt" "path" + "runtime" "sync" "time" @@ -125,6 +126,10 @@ func FlushQueue() { logging.LogErrorf("commit tx failed: %s", err) return } + + if 16 < i && 0 == i%256 { + runtime.GC() + } } elapsed := time.Now().Sub(start).Milliseconds()