From ffb4f4b32c834ca859359265e0302f31ff96cd0e Mon Sep 17 00:00:00 2001 From: meichler Date: Wed, 26 Feb 2025 12:15:46 +0200 Subject: [PATCH 1/3] Add heap memory logger --- .npmrc | 4 ++-- docusaurus.config.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.npmrc b/.npmrc index ad1b4b4e5..830457eb1 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,2 @@ -# Default node limit is 2 GB. GitLab with high-memory-tag limit is 32 GB. We increase it here to 30 GB. -node-options=--max-old-space-size=30720 +# Default node limit is 2 GB. GitLab with high-memory-tag limit is 32 GB. We increase it here to 25 GB. +node-options=--max-old-space-size=25600 diff --git a/docusaurus.config.js b/docusaurus.config.js index 08362cb5a..de542add5 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -7,6 +7,7 @@ const visit = require("unist-util-visit"); const fs = require("fs"); const marketplace = JSON.parse(fs.readFileSync("./index.json")); +const memoryLogger = require('./memoryLogger'); const remarkPlugin = () => { const transformer = (root) => { @@ -231,6 +232,7 @@ module.exports = { { gtm: "GTM-KWZSPLM", //GTM-XXXXXX }, + memoryLogger(), ] ], onBrokenLinks: "warn", From e99018a3c596adbfb374ead999708a5cc74e343e Mon Sep 17 00:00:00 2001 From: meichler Date: Wed, 26 Feb 2025 13:34:44 +0200 Subject: [PATCH 2/3] Add heap memory logger --- memoryLogger.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 memoryLogger.js diff --git a/memoryLogger.js b/memoryLogger.js new file mode 100644 index 000000000..2aba17e15 --- /dev/null +++ b/memoryLogger.js @@ -0,0 +1,14 @@ +module.exports = function memoryLoggerPlugin() { + return { + name: 'memory-logger-plugin', + async loadContent() { + console.log('Initial Memory Usage:', process.memoryUsage()); + }, + async contentLoaded({content, actions}) { + console.log('After Content Loaded:', process.memoryUsage()); + }, + async postBuild(props) { + console.log('After Build:', process.memoryUsage()); + }, + }; +}; \ No newline at end of file From 4c85f147aa99349dacb5c601bcb1c099661d4a1b Mon Sep 17 00:00:00 2001 From: meichler Date: Wed, 26 Feb 2025 14:35:19 +0200 Subject: [PATCH 3/3] fix memory logs plugin --- docusaurus.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index de542add5..9d02fe9ba 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -232,8 +232,8 @@ module.exports = { { gtm: "GTM-KWZSPLM", //GTM-XXXXXX }, - memoryLogger(), - ] + ], + memoryLogger(), ], onBrokenLinks: "warn", onBrokenMarkdownLinks: "warn",