Skip to content
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

Doesn't report garbage collector #26

Closed
logidelic opened this issue Jun 27, 2019 · 2 comments
Closed

Doesn't report garbage collector #26

logidelic opened this issue Jun 27, 2019 · 2 comments

Comments

@logidelic
Copy link

It seems that blocked-at won't report blocking due to garbage collection. For example, I have the following in my code:

var beg = Date.now();
global.gc();
console.log(Date.now()-beg)

Which in my (crazy) case reports 200ms, but blocked-at seems silent about... Could I be misunderstanding something or is this a real deficiency?

@naugtur
Copy link
Owner

naugtur commented Jul 26, 2019

It depends on the function wrapping your code. blocked-at uses async hooks and some of the ways your code can run are not tracked by async hooks (yet, opefully)
eg. bluebird promises only recently started being visible to hooks.

If you use native promises and put this code in a then function, it should work. No guarantees though :)

Feel free to reopen

@naugtur naugtur closed this as completed Jul 26, 2019
@logidelic
Copy link
Author

Two notes:

  • I am using native promises.
  • This is in an Electron (5) app. Perhaps that's relevant.

Thanks regardless for the cool library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants