Skip to content

[native-image] server usage doesn't produce reliable images across builds #1952

Closed
@aclement

Description

@aclement

I have my simplest spring app. If I compile with --no-server I always get the same image and same output. If I try to run with a server, my image changes size across multiple builds and the output from my app changes. Here are two images built in sequence with the server:


Compile with server, first build (69 seconds):

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::

Dec 06, 2019 4:07:41 PM org.springframework.boot.StartupInfoLogger logStarting
INFO: Starting CommandlinerunnerApplication on Andys-MacBook-Pro-2018.local with PID 51764 (/Users/aclement/gits/spring-graal-native/spring-graal-native-samples/commandlinerunner/clr started by aclement in /Users/aclement/gits/spring-graal-native/spring-graal-native-samples/commandlinerunner)
Dec 06, 2019 4:07:41 PM org.springframework.boot.SpringApplication logStartupProfileInfo
INFO: No active profile set, falling back to default profiles: default
Dec 06, 2019 4:07:41 PM org.springframework.boot.StartupInfoLogger logStarted
INFO: Started CommandlinerunnerApplication in 0.041 seconds (JVM running for 0.045)
CLR running!

real    0m0.136s
user    0m0.032s
sys     0m0.022s

Compile with server, second build (48s):

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::

CLR running!

real    0m0.138s
user    0m0.035s
sys     0m0.021s

Notice all the logging is gone in the second image. To recreate:

git clone https://github.com/spring-projects-experimental/spring-graal-native
cd spring-graal-native/spring-graal-native-feature
git checkout upgrade_19_3
mvn clean package
cd ../spring-graal-native-samples/commandlinerunner
Modify compile.sh to remove --no-server then run it.

Activity

aclement

aclement commented on Dec 7, 2019

@aclement
Author

Forgot to say, this is mac (pre catalina) with dev build of graal (commit #5a9edeb3ef) on Java 11 base.

sdeleuze

sdeleuze commented on Jun 3, 2020

@sdeleuze
Collaborator

FYI I am not able to build spring-graalvm-native in a reliable way without --no-server using GraalVM 20.1.0 so we are going to use this option by default for now.

added this to the 20.2 milestone on Jun 3, 2020
eginez

eginez commented on Jun 22, 2020

@eginez
Contributor

see #2598

eginez

eginez commented on Jun 30, 2020

@eginez
Contributor

close with #2598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @sdeleuze@eginez@aclement@vjovanov@cstancu

      Issue actions

        [native-image] server usage doesn't produce reliable images across builds · Issue #1952 · oracle/graal