-
Notifications
You must be signed in to change notification settings - Fork 57
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
fix: fix nested gc callback #188
Conversation
Codecov Report
@@ Coverage Diff @@
## master #188 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 9 9
Lines 296 296
=========================================
Hits 296 296 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
@theanarkh 这样改后对于 nested 的 gc profiling 会丢失吧,不过我比较好奇什么情况下会出现 gc 嵌套的场景 |
社区的同学这样说的。我测试的时候,kGCTypeProcessWeakCallbacks 总是嵌套到 kGCTypeMarkSweepCompact 里,所以我理解是时间会算到 kGCTypeMarkSweepCompact 里了。我没有找到复现的代码,是在公司的项目里发现的,目前这样改动是最小的,否则遇到嵌套 GC 的话,目前的实现应该是会出现文件数据错乱?我在公司项目里解决方法是在 GC start 和 end 的时候都写一个完整的 json 对象到文件里,然后解析的时候把文件里的对象数组当作一个栈,匹配同类型的 start 和 end 计算出耗时,这样看起来是能区分出 kGCTypeProcessWeakCallbacks 类型的 GC 耗时。 |
这个改动应该没什么问题。 |
谢谢提交修复! |
fix nested gc callback.
Refs: nodejs/node#44058