On Fri, Sep 27, 2013 at 12:04 PM, Craig Thomson <cr...@craigthomson.me.uk> wrote: > Hi, > > I am trying to understand a bit of the v8 source to do with garbage > collection and I am hoping that someone can give me a pointer in the right > direction. > > How does v8 decide when to do Garbage collection? Is there a timer, or is it > based on how much code is executed or something more complicated? > > Cheers, > Craig
Memory pressure, basically. When an allocation fails because the JS heap is full, that's when V8 starts collecting garbage. (The actual algorithm is more complicated, of course; it may also choose to grow the JS heap, for instance.) Embedders can call v8::V8::IdleNotification() to hint that now is a good time to do some scavenging. -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.