Skip to content
This repository was archived by the owner on May 29, 2024. It is now read-only.

Backport JEP345: NUMA-Aware Memory Allocation for G1 #13

Closed
helloguo opened this issue Dec 7, 2020 · 4 comments
Closed

Backport JEP345: NUMA-Aware Memory Allocation for G1 #13

helloguo opened this issue Dec 7, 2020 · 4 comments

Comments

@helloguo
Copy link

helloguo commented Dec 7, 2020

Hi, GraalVM experts,

I want to run my application, which currently runs on Java11 with G1 GC, with GraalVM and flag +XX:+UseNUMA. Here are some options I'm thinking of:

  1. Backport JEP345 NUMA-Aware Memory Allocation for G1 (https://openjdk.java.net/jeps/345) to labs-openjdk-11 and build GraalVM-Java11 from here.
  2. Build GraalVM for Java 15 based on labs-openjdk15 (https://github.com/graalvm/labs-openjdk-15). Upgrade my application to Java 15 and run it on GraalVM-Java15.
  3. Upgrade my application to Java 15 and run it on OpenJDK15 (http://openjdk.java.net/projects/jdk/15/) with flag -XX:+UseJVMCICompiler to enable Graal compiler.

Option 2 seems not working at this moment based on comment from oracle/graal#2948. And I cannot tell when GraalVM for Java 15 will be ready to build/use. Option 3 seems risky as well because Graal compiler in OpenJDK is not guaranteed to be updated very frequently. This OpenJDK issue talks about removing it from Oracle builds as of JDK 16 https://bugs.openjdk.java.net/browse/JDK-8255616. Option 1 seems reasonable to me. However, I'd like to hear your suggestions first :) If option 1 makes any sense, is there existing effort already? Thanks.

@dougxc
Copy link
Member

dougxc commented Dec 8, 2020

There is no existing effort to backport JEP 345 to labs-openjdk-11. Given the size of the change, it's also something we'd rather avoid if OracleJDK is not doing it as it adds significant overhead maintainance.

I'd suggest to wait until GraalVM comes out on JDK 15 (or 16). We're working on this currently but I don't want to make predictions on how soon it will be ready.

@helloguo
Copy link
Author

helloguo commented Dec 8, 2020

I'd suggest to wait until GraalVM comes out on JDK 15 (or 16). We're working on this currently but I don't want to make predictions on how soon it will be ready.

@dougxc Thanks for your suggestion. Is there a list which tracks the issues of building GraalVM on JDK15? Probably community members may help solve some of the issues to speed up the process :)

I appreciate it if you could share any comments on option 3, which runs OpenJDK15 with flag -XX:+UseJVMCICompiler to enable Graal compiler. It seems a short term solution before GraalVM on JDK15(or 16) is ready. OpenJDK's Graal compiler source code (https://github.com/openjdk/jdk15u/tree/master/src/jdk.internal.vm.compiler/share/classes) was updated quite frequently before July. However, it was only updated once since August. Not sure if this would be any concern.

@dougxc
Copy link
Member

dougxc commented Dec 8, 2020

Probably community members may help solve some of the issues to speed up the process :)

@christianwimmer since most of the JDK 15 work items are Native Image related, maybe this is a good opportunity to get some help?

any comments on option 3

It doesn't seem like there's any downside to just trying it. To use GraalVM on JDK 15, your app will need to be upgraded anyway. In terms of the stability of Graal in the OpenJDK, it has historically been fairly well tested so things may just work.

@helloguo
Copy link
Author

@dougxc In terms of backporting JEP345 into labs-openjdk-11, a downstream distribution of OpenJDK bishengjdk-11 (https://gitee.com/openeuler/bishengjdk-11) backported it and provided a clean patch (https://gitee.com/src-openeuler/openjdk-11/blob/master/8210473-JEP-345-NUMA-Aware-Memory-Allocation-for-G1.patch) that works with the latest release of OpenJDK11. Can you consider applying it into labs-openjdk-11? I totally understand the maintenance overhead of a feature like this. However, compared with the three original patches in OpenJDK14(https://bugs.openjdk.java.net/browse/JDK-8210473), the single patch from bishengjdk-11 is relatively easy to apply into labs-openjdk-11.

For some applications, it's not straightforward to upgrade to Java15. Meanwhile, some of those applications could really benefit from NUMA support from G1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants