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

v8::Isolate::GetCurrent()->IdleNotificationDeadline not working in 3.x (manual gc not working) #2478

Closed
marcominetti opened this issue Aug 20, 2015 · 8 comments
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. v8 engine Issues and PRs related to the V8 dependency.

Comments

@marcominetti
Copy link

Hi there, I'm currently maintaining the node-memwatch package against latest iojs/nodejs versions, available as memwatch-next on npm.

I've noticed that with new v8 version 4.4.63.26 the IdleNotification does not trigger GC at all.

I'm using both NaN 2.0.5 and direct v8::Isolate::GetCurrent()->IdleNotificationDeadline call with 500ms, 1s and 5s.

The gc seems not to be executed. I can make it run successfully with --expose-gc flag through the global.gc() function.

@marcominetti
Copy link
Author

example code (from memwatch):

NAN_METHOD(memwatch::trigger_gc) {
    Nan::HandleScope scope;
    while(!(v8::Isolate::GetCurrent()->IdleNotificationDeadline(0.500))) {};

    //while(!Nan::IdleNotification(500)) {};

    info.GetReturnValue().Set(Nan::Undefined());
}

@bnoordhuis
Copy link
Member

Do you start iojs with --use_idle_notification? It's a complete no-op without that flag.

@Fishrock123 Fishrock123 added c++ Issues and PRs that require attention from people who are familiar with C++. v8 engine Issues and PRs related to the V8 dependency. labels Aug 20, 2015
@marcominetti
Copy link
Author

I supposed that flag was enabled by default... I'll try when back to the office.

Has been changed something in iojs 3.x? Everything works fine till 2.5.0 branch.

@bnoordhuis
Copy link
Member

I take back what I said, I see that --use_idle_notification is on by default. Does v8::Isolate::IdleNotification() work?

@marcominetti
Copy link
Author

Nope. Seems something not working in v8...

@marcominetti
Copy link
Author

Should we suppose the strategy to call

while(!(v8::Isolate::GetCurrent()->IdleNotificationDeadline(0.500))) {};

is deprecated cause new IdleNotification implementation does not returns true as consistently as before?

@kkoopa
Copy link

kkoopa commented Aug 21, 2015

That is probably a safe assumption. IIRC, there was never a guarantee of this triggering garbage collection. Only reliable way is by the functionality exposed with --expose-gc.

@Fishrock123
Copy link
Contributor

Closing unless there is actually something we can do about this and/or should. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

No branches or pull requests

4 participants