Skip to content

Commit

Permalink
src: dump isolate stats when process exits
Browse files Browse the repository at this point in the history
When process exits, dump v8 isolate's internal stats for performance
evaluation and debugging.
It fixed the incorrect profiling log output when running V8's builtin
PGO profiling for node.js service type application,which exits by user
pressing CTRL+C etc. keys.

PR-URL: nodejs/node#44534
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
qdaoming authored and guangwong committed Jan 3, 2023
1 parent 7015fd4 commit 28e4aa4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/api/environment.cc
Expand Up @@ -761,6 +761,7 @@ ThreadId AllocateEnvironmentThreadId() {
void DefaultProcessExitHandler(Environment* env, int exit_code) {
env->set_can_call_into_js(false);
env->stop_sub_worker_contexts();
env->isolate()->DumpAndResetStats();
DisposePlatform();
uv_library_shutdown();
exit(exit_code);
Expand Down

0 comments on commit 28e4aa4

Please sign in to comment.