On 2009/12/17 14:35:02, Søren Gjesse wrote: > LGTM > - even though this is a somewhat scary path...
> Maybe we should consider putting this behind a flag but have it default to true. > This makes it easy to turn it off for testing. > The problematic part is that we will never compact the heap again nor > free any > pages after map space has out-grown the size where map pointers cannot be > encoded. > We should consider adding compacting of map space (in a new CL) if the > number of > live maps after a mark-sweep is below the threshold. Kevin has a idea of > how to > do this: > 1. Move maps into the first pages of the map space leaving a forwarding pointer > in the moved maps. This can be done using one pointer starting at the beginning > of map space and another pointer starting at the end. Sweeping backwards > is > possible as we know exactly the what is in map space, however the linked > list of > pages adds some complications. > 2. Sweep the heap to make map pointers pointing to a forwarded map point > to the > new location. > 3. Free all the unused pages of map space. After talking to Kevin again the backwards scan is not required. The number of live maps gives the number of pages of map pages required to hold all live maps. Skip past these to find the first page from which to start relocating maps. This page and the rest of the pages in teh map space will be free after the map compaction. http://codereview.chromium.org/507025 -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
