Skip to content

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

Description

@marcominetti

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.

Activity

  1. marcominetti commented on Aug 20, 2015

    @marcominetti
    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());
    }
    
  2. bnoordhuis commented on Aug 20, 2015

    @bnoordhuis
    Member

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

  3. added
    c++Issues and PRs that require attention from people who are familiar with C++.
    v8 engineIssues and PRs related to the V8 dependency.
    on Aug 20, 2015
  4. marcominetti commented on Aug 20, 2015

    @marcominetti
    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.

  5. bnoordhuis commented on Aug 21, 2015

    @bnoordhuis
    Member

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

  6. marcominetti commented on Aug 21, 2015

    @marcominetti
    Author

    Nope. Seems something not working in v8...

  7. marcominetti commented on Aug 21, 2015

    @marcominetti
    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?

  8. kkoopa commented on Aug 21, 2015

    @kkoopa

    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.

  9. Fishrock123 commented on Aug 22, 2015

    @Fishrock123
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions