Thanks! I found this article which describes the process in a bit more detail.
http://www.jayconrod.com/posts/55/a-tour-of-v8-garbage-collection Part of the problem I was looking at was why v8 was spending so much time in the garbage collector when I profiled it. It turns out that was because it was in debug and it was doing lots of extra work compared to release. Cheers, Craig On Friday, 27 September 2013 11:52:27 UTC+1, Ben Noordhuis wrote: > > On Fri, Sep 27, 2013 at 12:04 PM, Craig Thomson > <cr...@craigthomson.me.uk <javascript:>> 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.