From 003a55995c7ee48889d26af1ec68b1ee4f7113d9 Mon Sep 17 00:00:00 2001 From: jsers Date: Mon, 7 Nov 2022 18:55:52 +0800 Subject: [PATCH 1/2] debug memory leak --- package-lock.json | 28 ++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index d99be95a..e78c0d89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -82,6 +82,7 @@ "babel-traverse": "^6.26.0", "babel-types": "^6.26.0", "better-babel-generator": "^6.26.1", + "cross-env": "^7.0.3", "dotenv": "^16.0.1", "less": "^4.1.1", "less-loader": "^8.1.1", @@ -3365,6 +3366,24 @@ "resolved": "https://registry.nlark.com/crelt/download/crelt-1.0.5.tgz", "integrity": "sha1-V8DVKvjIWeNUus4Yg+suHrGCu5Q=" }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-7.0.3.tgz?cache=0&sync_timestamp=1609302869441&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcross-spawn%2Fdownload%2Fcross-spawn-7.0.3.tgz", @@ -12834,6 +12853,15 @@ "resolved": "https://registry.nlark.com/crelt/download/crelt-1.0.5.tgz", "integrity": "sha1-V8DVKvjIWeNUus4Yg+suHrGCu5Q=" }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-7.0.3.tgz?cache=0&sync_timestamp=1609302869441&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcross-spawn%2Fdownload%2Fcross-spawn-7.0.3.tgz", diff --git a/package.json b/package.json index 26723cf2..f2ad2d61 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "scripts": { "dev": "vite --port 8765 --host", "dev:advanced": "vite --port 8765 --host --mode advanced", - "build": "tsc && vite build", + "build": "tsc && node -e 'console.log(v8.getHeapStatistics().heap_size_limit/(1024*1024))' && cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build", "build:advanced": "node comb_feats ${npm_config_custom_options} && tsc && vite build --mode advanced", "serve": "vite preview" }, From f8cf0b16d64284b3437115df926e0a4160e92fb3 Mon Sep 17 00:00:00 2001 From: jsers Date: Mon, 7 Nov 2022 19:00:08 +0800 Subject: [PATCH 2/2] debug memory leak --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index f2ad2d61..117486ee 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,7 @@ "babel-traverse": "^6.26.0", "babel-types": "^6.26.0", "better-babel-generator": "^6.26.1", + "cross-env": "^7.0.3", "dotenv": "^16.0.1", "less": "^4.1.1", "less-loader": "^8.1.1",