RFR: Reduce waste in humongous allocations
Roman Kennke
rkennke at redhat.com
Tue Dec 13 17:11:38 UTC 2016
as Aleksey has shown, when repeatedly allocating humongous objects, we
tend to leave gaps between them. The reason is that we start looking
for contigous regions starting one region after the current
(allocation) region, and then discard that alloc region, starting a new
one after the humongous object.
The fix is two-fold:
- Instead of discarding currently active allocation regions, we re-
append them to the free-list (together with any free regions that we
skipped while searching a contiguous block). This should be useful,
e.g. when we have a not-totally-filled alloc region and then allocate a
humongous object.
- When searching for contigous space, also consider the current alloc
region. The complication here is that we must prevent concurrent
allocations from it. This patch does it by pre-emptively allocating
region-sized chunk, which has two effects: it blocks concurrent
allocations and it tells us if the region is free in a concurrency-safe
manner. If our search for contiguous block fails, we revert that by
freeing such regions again.
It passes jtreg tests and SPECjvm.
http://cr.openjdk.java.net/~rkennke/fixhumongousalloc/webrev.00/
Ok?
Roman
More information about the shenandoah-dev
mailing list