On Thu, Mar 28, 2013 at 2:58 PM, Sam Lin <[email protected]> wrote:
> Hi, > > about the type of garbage collection, > > I have two questions, > > 1. Full non-compacting collection > I have no idea about the free memory gets added to free lists. > Why V8 does this and what's this for? > As you mention below yourself, compacting collections clean up fragmentation but are more expensive. When fragmentation is not a problem (yet), a non-compacting collection is sufficient. > 2. I can see that Scavenge occurs all the time. But when do full > non-compacting collection and full compacting collection happen? > How V8 choose these two different types of gc? > Scavenging moves live objects from new space to old space, freeing up new space. Full collections clean up garbage in old space. The rules when exactly full collections are triggered are fairly complex -- there must be a compromise between getting rid of garbage quickly enough without spending too much time looking for it. > Full compacting collection is able to get rid of fragmentation which means > we need to copy a lot of objects. > > This is what I heard from google i/o, however, i dont know why he > mentioned about "copy". I thought that those objects should be "moved" > instead of copy. > Objects are moved by copying them and discarding the original. The latter is basically a no-op (no need to overwrite, just mark the region as free), so the cost is determined by the copying. How else would you implement moving? > > > > Thanks > > -- > -- > v8-users mailing list > [email protected] > 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 [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- v8-users mailing list [email protected] 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
