Perf: wasted region after humongous alloc?

Aleksey Shipilev shade at redhat.com
Tue Dec 13 09:47:17 UTC 2016


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