+63
−16
Loading
some suggestions from Douglas. Currently, if there's not enough free space left in the region, a large alloc is done. Douglahs suggested increasing the threshold, which we have increased from 32 to PAGE_SIZE/64. Also, he mentioned it's a bug that we abandon the region if we have a large object allocate. We now also do a large alloc if the object is large enough. (The object won't get copied in the next GC, so that's a win.) Finally, we add a simple heuristic where we keep track of how many consecutive large allocs have been done. If the threshold is exceeded, we abandon the region (wasting space) and allocate a new region. This prevents spectacularly bad performance (10 times slower or more) on sparc when the object is small, and there's some room in the region but not enough for the object. The boxed region would never get updated so the allocation would never be inline. For debugging, the consecutive alloc limit is a variable. We also keep track of how many times we abandon a region.