-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
100% CPU usage for a long time after execution of the last statement #48581
Labels
Comments
bnoordhuis
added
confirmed-bug
Issues with confirmed bugs.
v8 engine
Issues and PRs related to the V8 dependency.
labels
Jun 28, 2023
You're basically hitting pathological behavior in V8. Node is waiting for V8's optimizer to finish a compilation job but I suspect it's exhibiting quadratic behavior that gets exacerbated by the size of the function. I suggest reporting this to V8 because it's not something we can fix. The stack trace:
|
https://groups.google.com/g/v8-dev/c/OUb4BRUnTgI/m/wF25A6SzAAAJ Problem disappears with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Version
v12.x-v20.x - severe, v8.x - v10.x - less severe but still visible
Platform
Darwin Andreys-MacBook-Pro.local 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000 arm64
Subsystem
suspect GC
What steps will reproduce the bug?
run first script in the gist: https://gist.github.com/sidorares/128160e6b3dea1da3ad45cd672651d2d#file-repro1-js
After last line
console.log("done");
is executed CPU spikes to 100% and stays like that for about 5 minutes.In case of node v8 and v10 cpu spike is much shorter, 5-7 seconds.
Bun.js executes the script almost instantly
How often does it reproduce? Is there a required condition?
Consistently reproduceable
What is the expected behavior? Why is that the expected behavior?
the script is expected to finish in sub second time
What do you see instead?
CPU spikes for 300-400 seconds which is unexpected for the workload
Additional information
The profiler only reports the code before the CPU spike, no high GC usage, the time after cpu spike is "unaccounted".
The text was updated successfully, but these errors were encountered: