sampling-heap-profiler icon indicating copy to clipboard operation
sampling-heap-profiler copied to clipboard

Use Nan::Set to accommodate for Node 14+

Open srubin opened this issue 5 years ago • 8 comments

When trying to build heap-profile with Node 14+ (warns on 12+, fails on 14+), the node-gyp compilation fails:

../bindings/sampling-heap-profiler.cc:26:12: error: no matching member function for call to 'Set'
  js_node->Set(Nan::New<String>("name").ToLocalChecked(),
  ~~~~~~~~~^~~
{path}/node-gyp/14.15.0/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,

Looking at the Nan docs suggests that we could instead use Nan::Set to set object properties in a version-independent way.

srubin avatar Oct 29 '20 19:10 srubin

hello, this still a issue for me, there is any workaround?

rafaelzomer avatar Oct 26 '21 14:10 rafaelzomer

are there plans to merge this?

JCMais avatar Dec 16 '21 13:12 JCMais

I abandoned this fix because I realized that this is the same tool as the "Allocation sampling" tool that's already available with node.js debugging (via Chrome's chrome://inspect).

image

srubin avatar Dec 16 '21 21:12 srubin

Any plans to merge this? We require this change to generate heap-profile in the node js application.

I tried your changes and it is getting installed in node v14.18.1 @srubin, Please merge this PR.

ankursachdeva11 avatar Mar 04 '22 07:03 ankursachdeva11

Did you see my above post? This tool is now integrated in Chrome's debugging tools directly (via chrome://inspect). I suspect that this repo is dead.

srubin avatar Mar 04 '22 14:03 srubin

@srubin , Chrome Debugging tools can be used directly in UI applications.

But we need this change to get the heap-profile in the backend server which doesn't have any UI. In this case, we can not use Chrome Debugger to get the heap profile.

If we can install a heap-profiler in node v14 then we will be able to get the heap profile whenever we found there is an increase in memory.

Please take this request and get it merged. Thanks

ankursachdeva11 avatar Mar 10 '22 05:03 ankursachdeva11

I'm not affiliated with the v8 team; I don't have any particular power to get this merged.

srubin avatar Mar 10 '22 14:03 srubin

@ofrobots Any plans to get this merged to support Node v14 and higher as we are also looking to profile our back-end application.

mastery-amit-sahani avatar Jul 15 '22 14:07 mastery-amit-sahani

@ofrobots @bariscicek Is there anything that needs to be done before this can be merged? Or is this project abandoned?

malte-j avatar Aug 30 '22 15:08 malte-j

This repo is being archived (see README.md for more information). Closing all PRs in anticipation of this.

nolanmar511 avatar Sep 28 '22 17:09 nolanmar511