From e214543c86b827c22fd4c74b249819fc79e40939 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 26 Jan 2023 13:52:22 +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/model/import.go | 5 +++-- kernel/model/mount.go | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/kernel/model/import.go b/kernel/model/import.go index 941cc1ab1..3dd5dc16d 100644 --- a/kernel/model/import.go +++ b/kernel/model/import.go @@ -31,7 +31,7 @@ import ( "os" "path" "path/filepath" - "runtime/debug" + "runtime" "sort" "strconv" "strings" @@ -708,8 +708,9 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) { } IncSync() } - debug.FreeOSMemory() + IncSync() + runtime.GC() return } diff --git a/kernel/model/mount.go b/kernel/model/mount.go index 1b7c6b74a..06b419bfb 100644 --- a/kernel/model/mount.go +++ b/kernel/model/mount.go @@ -21,7 +21,6 @@ import ( "fmt" "os" "path/filepath" - "runtime/debug" "strings" "time" "unicode/utf8" @@ -132,7 +131,6 @@ func unmount0(boxID string) { boxConf.Closed = true box.SaveConf(boxConf) box.Unindex() - debug.FreeOSMemory() } func Mount(boxID string) (alreadyMount bool, err error) {