From 13e6ff8557841885049a224d8380fd149fd15a71 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 26 Jan 2023 20:45:39 +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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/sql/queue.go b/kernel/sql/queue.go index df9cfe9f2..c8528f850 100644 --- a/kernel/sql/queue.go +++ b/kernel/sql/queue.go @@ -128,11 +128,15 @@ func FlushQueue() { return } - if 16 < i && 0 == i%256 { + if 16 < i && 0 == i%128 { runtime.GC() } } + if 128 < len(ops) { + runtime.GC() + } + elapsed := time.Now().Sub(start).Milliseconds() if 5000 < elapsed { logging.LogInfof("op tx [%dms]", elapsed)