From 7906dc97c63d651634d6a6a5607ff31b3645d3de Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 31 Aug 2023 21:27:37 +0800 Subject: [PATCH] :art: Reduce the memory usage of PDF asset file content parsing on the mobile https://github.com/siyuan-note/siyuan/issues/9079 --- kernel/model/asset_content.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/model/asset_content.go b/kernel/model/asset_content.go index 402e981b4..709be2844 100644 --- a/kernel/model/asset_content.go +++ b/kernel/model/asset_content.go @@ -776,6 +776,9 @@ func (parser *PdfAssetParser) Parse(absPath string) (ret *AssetParseResult) { cores := runtime.NumCPU() if 4 < cores { cores = 4 // Limit memory usage + if util.ContainerIOS == util.Container || util.ContainerAndroid == util.Container { + cores = 1 // Reduce the memory usage of PDF asset file content parsing on the mobile https://github.com/siyuan-note/siyuan/issues/9079 + } } pool, err := webassembly.Init(webassembly.Config{