-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
v8: add heap profile API #60231
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
base: main
Are you sure you want to change the base?
v8: add heap profile API #60231
Conversation
Review requested:
|
70788c9
to
9024efa
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #60231 +/- ##
=======================================
Coverage 88.56% 88.57%
=======================================
Files 704 704
Lines 208125 208176 +51
Branches 40003 40019 +16
=======================================
+ Hits 184332 184386 +54
- Misses 15809 15822 +13
+ Partials 7984 7968 -16
🚀 New features to boost your workflow:
|
@@ -279,6 +279,30 @@ void StopCpuProfile(const FunctionCallbackInfo<Value>& args) { | |||
} | |||
} | |||
|
|||
void StartHeapProfile(const FunctionCallbackInfo<Value>& args) { | |||
Isolate* isolate = args.GetIsolate(); | |||
if (isolate->GetHeapProfiler()->StartSamplingHeapProfiler()) { |
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.
StartSamplingHeapProfiler
returns false if a sampling heap profiler is already running, we should check the value if false we stop this operation.
https://v8docs.nodesource.com/node-6.17/d7/d76/classv8_1_1_heap_profiler.html#ada00bb7ec0b7827ce97280a1fb6e1f64
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.
Thanks for reviewing ! An Error will be thrown in the following code when false is returned.
Refs: #59807
make -j4 test
(UNIX), orvcbuild test
(Windows) passes