Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-51307] Unable to collect GC data with NotificationEmitter in native build #7803

Closed
viniciusxyz opened this issue Nov 11, 2023 · 3 comments
Assignees

Comments

@viniciusxyz
Copy link

viniciusxyz commented Nov 11, 2023

Describe the problem

I'm developing applications and I'm missing some statistics when using Micrometer, being more specific the details and duration of GC pauses, I started validating the lib code and noticed that the problem is actually that it seems that NotificationEmitter is not working launching the notification events and this only happens in the native image, these metrics are very important for us to be able to put the applications into production, so I would like help to solve this problem.

Steps to reproduce the issue

  1. git clone --depth 1 https://github.com/viniciusxyz/graalvm-issue-7803-notification-emmiter.git
  2. Build app mvn clean package -Pnative
  3. Run app ./target/main-notification-emitter

When running the native image, only the notifier addition log will be displayed, and when running with hotspot, when System.gc() is called, a log is displayed from the emission of the NotificationEmitter event

Describe GraalVM and its environment:

  • GraalVM version: GraalVM CE 21+35.1 (build 21+35-jvmci-23.1-b15)
  • JDK major version: 21
  • OS: Windows 11
  • Architecture: AMD64

More details

Print execution with hotspot:

image

Print from execution with native compilation:

image

@kassifar kassifar self-assigned this Jan 12, 2024
@kassifar
Copy link

Hi @viniciusxyz, thank you for reporting this issue. We will be taking it a look at it shortly.

@wirthi
Copy link
Member

wirthi commented Jan 17, 2024

Hi @viniciusxyz

you are correct that there are some open issues around the management interfaces where we still need some work.

The concrete problem for this very case here seems to be, though, that you are trying to use G1GC with the CE version of GraalVM, which is not supported. G1 is an enterprise-only feature.

@wirthi wirthi closed this as completed Jan 17, 2024
@viniciusxyz
Copy link
Author

viniciusxyz commented Jan 17, 2024

@wirthi The issue is not about a compilation problem but about the lack of some events associated with the garbage collector, the example I added in the issue can be executed perfectly to reproduce the problem and in this case the print with the G1 was just due to from graalvm hotspot ergonimics, follow the print below adding serialgc so you can see that the problem is the same regardless of G1 or not:

image

All compilation configuration is in the pom file of the project passed in the example

To prove that the problem does not depend on whether it is graalvm ce or oracle graalvm, the print follows with the same behavior:

image

Currently, from what I know, there are two main ways of exposing information about garbage collector execution times during the execution of the application so that we can continuously visualize it, the first is through a javaagent that exports this information to any provider such as Prometheus and another is by adding some lib that sends these metrics to one of these providers, but as far as I've seen both forms depend on notificationEmmiter for updates related to these metrics, without this improvement several applications that monitor the GC via Prometheus + micrometer for example will be left without the data for monitoring related to GC times.

@wirthi @kassifar
Could you reopen the issue please? I believe this is a desired feature for those who are going to put applications into production.

@wirthi wirthi changed the title Unable to collect GC data with NotificationEmitter in native build [GR-51307] Unable to collect GC data with NotificationEmitter in native build Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants