Perf: wasted region after humongous alloc?

Roman Kennke rkennke at redhat.com
Tue Dec 13 09:55:15 UTC 2016


It's probably because we're unconditionally skipping to the next region
in ShenandoahFreeSet::claim_contiguous(), assuming that normally the
'current' region is already allocated into. This might not be the case
though, especially when commonly allocating region-sized TLABs.

In any case, it is wasteful. Do you want to look into this?

Roman

Am Dienstag, den 13.12.2016, 10:47 +0100 schrieb Aleksey Shipilev:
> Hi,
> 
> Been playing with tests, and realized we have an peculiar behavior
> when
> allocating humongous objects, e.g. in:
> 
> public class Alloc {
>   static final int SIZE = Integer.getInteger("size", 2_000_000);
>   static Object sink;
> 
>   public static void main(String... args) throws Exception {
>     for (int c = 0; c < 1000000; c++) {
>       sink = new int[SIZE];
>     }
>   }
> }
> 
> The region logging prints this:
> 
> ...
> region 238, used = 4194304, live = 0, flags = <humongous>
> region 239, used = 4194304, live = 0, flags = <humongous>
> region 240, used = 0, live = 0, flags = <none>
> region 241, used = 4194304, live = 0, flags = <humongous>
> region 242, used = 4194304, live = 0, flags = <humongous>
> region 243, used = 0, live = 0, flags = <none>
> region 244, used = 4194304, live = 0, flags = <humongous>
> region 245, used = 4194304, live = 0, flags = <humongous>
> region 246, used = 0, live = 0, flags = <none>
> ...
> 
> So there seems to be an empty region right after the humongous
> allocation. Are
> we wasting it intentionally, or is it a bug? Seems wasteful either
> way.
> 
> Thanks,
> -Aleksey
> 


More information about the shenandoah-dev mailing list