[SOLVED] heap alloc appears to explode during garbage collection #560
Replies: 6 comments 6 replies
-
Not sure if this is related to zx or specific to your setup. Let's convert to discussion as it seems not an issue. |
Beta Was this translation helpful? Give feedback.
-
The entire process.mjs script is run, as said before, via function startProcess (url) {
const service = spawn ('./process.mjs', ['--url', url])
service.stdout.on('data', compose (console.log) (String))
service.stderr.on('data', compose (console.error) (String))
service.on('close', code => {
console.debug(`process exited with code ${code}`)
if (code === 500) {
console.error ('WE ARE IN A COMPLETELY BROKEN STATE AND NEED HUMAN HANDS!')
catastrophicError = true
} else {
isExecuting = false
executeFromQueue ()
}
})
}
const compose = f => g => x => f (g (x)) |
Beta Was this translation helpful? Give feedback.
-
1325166479500.6 MB is 1,294,107,890 Giga Bytes or 1.3 billion Giga Bytes! |
Beta Was this translation helpful? Give feedback.
-
Here is another random error that we have seen a few times:
nodejs: v18.12.1 |
Beta Was this translation helpful? Give feedback.
-
EDIT: We were running in Virtualbox 6.X and now we run in Virtualbox 6.1.38 which has stifled the memory errors. Here is another crash, this time from
|
Beta Was this translation helpful? Give feedback.
-
It appears to have been a bug in VirtualBox. We got our server guy to update to Virtualbox 6.1.38 and have not seen any memory errors since. |
Beta Was this translation helpful? Give feedback.
-
Edit 29-12-2022
It appears to have been a bug in VirtualBox. We got our server guy to update to Virtualbox 6.1.38 and have not seen any memory errors since.
Expected Behavior
The v8 garbage collector should reduce heap allocations.
Actual Behavior
The v8 garbage collector (GC) grows the heap allocations. If this is not the fault of V8 GC, it at least happens during GC and we are getting a reading of the current heap incidentally at the same time as GC is happening.
Steps to Reproduce the Problem
I will share our code. This is not code I am proud of but it does highlight an issue where
zx
and V8 clearly work against each other. I want to file a bug report in V8 issues but I do not know enough of howzx
shell calls are implemented to file a good bug report.Below is the content of process.mjs and the command that is used to execute the file.
spawn ('./process.mjs', ['--url', url])
One SIGSEGV (of many) error:
await $`wget ${uri} --directory-prefix ${tmpPath} --continue --quiet`
Here is the interesting bits:
1325166479500.6 MB is 1,294,107,890 Giga Bytes or 1.3 billion Giga Bytes!
Here is how to read the output from V8:
Source: https://nodejs.org/en/docs/guides/diagnostics/memory/using-gc-traces/
Specifications
7.1.1
Linux services 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Beta Was this translation helpful? Give feedback.
All reactions