Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add heap memory logger #1703

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -231,7 +232,8 @@ module.exports = {
{
gtm: "GTM-KWZSPLM", //GTM-XXXXXX
},
]
],
memoryLogger(),
],
onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",
Expand Down
14 changes: 14 additions & 0 deletions memoryLogger.js
Original file line number Diff line number Diff line change
@@ -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());
},
};
};
Loading