oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20.03k stars 1.6k forks source link

epsilon and G1 seem not to work with JFR in NI #8993

Open buuuuuuug opened 1 month ago

buuuuuuug commented 1 month ago

Describe the issue epsilon GC and G1 GC seems cannot work properly with JFR enabled in NI mode by throwing an error msg of Pool jdk.types.GCName must contain at least one element or Pool jdk.types.GCCause must contain at least one element sometimes on application start. while serial GC works just fine. is there anything that i possibly miss?

Steps to reproduce the issue Please include both build steps as well as run steps

  1. [git clone https://github.com/buuuuuuug/jfr-vth-pin.git]
  2. [gradle nativeCompile]
  3. [modify build.gradle file by buildArgs.add('--gc=G1') or buildArgs.add('--gc=sepsilon').]
  4. [./build/native/nativeCompile/jfr-vth-pin -XX:StartFlightRecording="filename=recording.jfr,settings=continue+vth.jfc"]

Describe GraalVM and your environment:

More details

    ~/IdeaProjects/jfr-vth-pin git:[main]
./build/native/nativeCompile/jfr-vth-pin -XX:StartFlightRecording="filename=recording.jfr,settings=continue+vth.jfc"
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.3.0)

2024-05-29T20:53:30.966+08:00  INFO 10553 --- [jfr-vth-pin] [           main] c.chaney.jfrvthpin.JfrVthPinApplication  : Starting AOT-processed JfrVthPinApplication using Java 21.0.2 with PID 10553 (/home/chaney/IdeaProjects/jfr-vth-pin/build/native/nativeCompile/jfr-vth-pin started by chaney in /home/chaney/IdeaProjects/jfr-vth-pin)
2024-05-29T20:53:30.966+08:00  INFO 10553 --- [jfr-vth-pin] [           main] c.chaney.jfrvthpin.JfrVthPinApplication  : No active profile set, falling back to 1 default profile: "default"
2024-05-29T20:53:31.024+08:00  INFO 10553 --- [jfr-vth-pin] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 8080 (http)
2024-05-29T20:53:31.026+08:00  INFO 10553 --- [jfr-vth-pin] [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2024-05-29T20:53:31.026+08:00  INFO 10553 --- [jfr-vth-pin] [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.24]
2024-05-29T20:53:31.040+08:00  INFO 10553 --- [jfr-vth-pin] [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2024-05-29T20:53:31.040+08:00  INFO 10553 --- [jfr-vth-pin] [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 74 ms
2024-05-29T20:53:31.115+08:00  INFO 10553 --- [jfr-vth-pin] [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 1 endpoint beneath base path '/actuator'
2024-05-29T20:53:31.124+08:00  INFO 10553 --- [jfr-vth-pin] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 8080 (http) with context path '/'
2024-05-29T20:53:31.140+08:00  INFO 10553 --- [jfr-vth-pin] [           main] c.chaney.jfrvthpin.JfrVthPinApplication  : Started JfrVthPinApplication in 0.203 seconds (process running for 0.251)
Exception in thread "JFR Event Stream 1" java.lang.InternalError: Pool jdk.types.GCName must contain at least one element 
        at jdk.jfr@21.0.2/jdk.jfr.internal.consumer.ChunkParser.fillConstantPools(ChunkParser.java:357)
        at jdk.jfr@21.0.2/jdk.jfr.internal.consumer.ChunkParser.<init>(ChunkParser.java:141)
        at jdk.jfr@21.0.2/jdk.jfr.internal.consumer.ChunkParser.<init>(ChunkParser.java:109)
        at jdk.jfr@21.0.2/jdk.jfr.internal.consumer.EventDirectoryStream.processRecursionSafe(EventDirectoryStream.java:150)
        at jdk.jfr@21.0.2/jdk.jfr.internal.consumer.EventDirectoryStream.process(EventDirectoryStream.java:124)
        at jdk.jfr@21.0.2/jdk.jfr.internal.consumer.AbstractEventStream.execute(AbstractEventStream.java:261)
        at jdk.jfr@21.0.2/jdk.jfr.internal.consumer.AbstractEventStream$1.run(AbstractEventStream.java:284)
        at jdk.jfr@21.0.2/jdk.jfr.internal.consumer.AbstractEventStream$1.run(AbstractEventStream.java:281)
        at java.base@21.0.2/java.security.AccessController.executePrivileged(AccessController.java:129)
        at java.base@21.0.2/java.security.AccessController.doPrivileged(AccessController.java:400)
        at jdk.jfr@21.0.2/jdk.jfr.internal.consumer.AbstractEventStream.run(AbstractEventStream.java:281)
        at jdk.jfr@21.0.2/jdk.jfr.internal.consumer.AbstractEventStream.lambda$startAsync$1(AbstractEventStream.java:224)
        at java.base@21.0.2/java.lang.Thread.runWith(Thread.java:1596)
        at java.base@21.0.2/java.lang.Thread.run(Thread.java:1583)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:833)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:211)
oubidar-Abderrahim commented 1 month ago

I believe G1 and epsilon are not supported in JFR based on https://github.com/oracle/graal/issues/8978 @roberttoyonaga can you please confirm?

roberttoyonaga commented 1 month ago

I believe G1 and epsilon are not supported in JFR based on https://github.com/oracle/graal/issues/8978 @roberttoyonaga can you please confirm?

Yes that's right. But using JFR with any of the other GCs should not throw exceptions. I'll look more into this.