forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add some memory debugging (aws#24970)
The build is running out of memory for unclear reasons. Add some debugging to figure out what's going on. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Script to get Node.js to print its memory usage periodically | ||
// | ||
// Use as follows: | ||
// | ||
// export NODE_OPTIONS="-r $PWD/scripts/log-memory.js ${NODE_OPTIONS:-}" | ||
const { memoryUsage } = require('process'); | ||
|
||
const MB = 1024 * 1024; | ||
|
||
setInterval(() => { | ||
const now = new Date(); | ||
const HH = `0${now.getHours()}`.slice(-2); | ||
const MM = `0${now.getMinutes()}`.slice(-2); | ||
console.error(`[${HH}:${MM}] [node:${process.pid}] rss=${(memoryUsage.rss() / MB).toFixed(1)}`); | ||
}, 60000).unref(); |