2

A demo project is available at: https://github.com/codependent/micronaut-graal-hello-world

I have created a basic Micronaut application following the instructions at: https://docs.micronaut.io/1.1.0.M1/guide/index.html#graalServices

The native image generation works fine using the included script ./build-native-image.sh

After creating it I launch ./micronaut-graal-hello-world

From the moment I launch the image in the shell it takes around 30 seconds to log this: 19:26:15.113 [main] INFO io.micronaut.runtime.Micronaut - Startup completed in 19ms. Server Running: http://localhost:8080

So, the Micronaut application starts fast as hell (19ms!!) but it takes the image 30 seconds to start. How is that possible? This makes the use of GraalVM images pointless since the startup time of the process is too slow.

NOTICE my env is MacOS Mojave

codependent
  • 23,193
  • 31
  • 166
  • 308
  • 1
    I'm on macos mojave and just tried building it, it starts in ms, there's no long pause on my machine. I'm not sure how to debug this process startup. Could it be related to resolving hostnames like here: https://stackoverflow.com/questions/30625785/intellij-freezes-for-about-30-seconds-before-debugging? – Oleg Šelajev Feb 24 '19 at 18:58
  • Hi Oleg. unfortunatelly I followed the instructions on that link to configure /etc/hosts but same startup time. I'll try on another mac with the same config to see if it behaves similarly. If it persists I'll open an issue. – codependent Feb 24 '19 at 19:11
  • I forgot to update this subject, after the /etc/hosts config and a restart everything started working fine with the image starting immediately. – codependent Feb 27 '19 at 11:33

0 Answers0