Increase the default amount of RAM reserved for the OS
Mitigation for OOM errors (137/SIGKILL) seen by users when we overcommit the available memory. For Unix, reserve 1GB. For Windows, reserve 1.5GB, as the OS needs more memory and estimates inaccurately.
This commit is contained in:
parent
88714e3a60
commit
4c94e29f1b
6 changed files with 39 additions and 12 deletions
|
|
@ -24,10 +24,11 @@ test("getToolNames", (t) => {
|
|||
|
||||
test("getMemoryFlag() should return the correct --ram flag", (t) => {
|
||||
const totalMem = Math.floor(os.totalmem() / (1024 * 1024));
|
||||
const expectedThreshold = process.platform === "win32" ? 1536 : 1024;
|
||||
|
||||
const tests = [
|
||||
[undefined, `--ram=${totalMem - 256}`],
|
||||
["", `--ram=${totalMem - 256}`],
|
||||
[undefined, `--ram=${totalMem - expectedThreshold}`],
|
||||
["", `--ram=${totalMem - expectedThreshold}`],
|
||||
["512", "--ram=512"],
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue