-
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
feat: support auto increase heap limit #217
Conversation
namespace xprofiler { | ||
static const char module_type[] = "heap_limit"; | ||
|
||
size_t NearHeapLimitCallback(void* data, size_t current_heap_limit, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
持续监听么?要不要增加一个 maxLimitation 的限制?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要,limit 其实只是一个值,它除了让 v8 判断是否需要 OOM,不会反映到实际内存上的
Codecov Report
@@ Coverage Diff @@
## master #217 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 317 318 +1
=========================================
+ Hits 317 318 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
背景
增加
enable_auto_incr_heap_limit
的配置,默认为false
即不开启此特性。如果开启
enable_auto_incr_heap_limit
为true
,则会使得 Node.js 进程在堆分配即将到达上限时可以自动增加heap_limit
续命。默认每次接近堆上限增加
256MB
的heap_limit
,这个值可以通过auto_heap_limit_size
来进行修改。TODO
等到 Node.js 进程内存水位恢复正常后使用
RemoveNearHeapLimitCallback
重设heap_limit
为initial_heap_limit