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.21k stars 1.62k forks source link

enable-monitoring option not working on windows : native image not found by visualvm #9563

Open cnico opened 2 weeks ago

cnico commented 2 weeks ago

Describe the issue We use native image to build windows native executables and it works very well. As the project gets bigger we investigate on monitoring of the native image to detect memory leak, cpu usage, etc. So we investigated on the option --enable-monitoring=all (same result with jvmstat or heapdump). The native image build is OK but visualvm does never find the native image processus. I did a simple project to reproduce the problem : https://github.com/cnico/native-image-maven-demo It builds and runs on linux with the correct expectation of visualvm finding the processus. But on windows it finds no processus to attach as native image. It works great for the java -jar execution of course.

Steps to reproduce the issue

  1. on a windows laptop with visual studio 2022 community edition installed
  2. git clone https://github.com/cnico/native-image-maven-demo
  3. mvn clean package
  4. start visualvm latest version 2.1.9
  5. run the exe native-image-maven-demo.exe
  6. visualvm should find the native image but finds nothing.

Describe GraalVM and your environment:

More details The generated native-image args file seems correct : @target\tmp\native-image-6483500328482094922.args :

-cp
D:\\platform_java21\\workspace\\native-image-maven-demo\\target\\demo-native-image-maven-1.0-SNAPSHOT.jar
--no-fallback
-o
D:\\platform_java21\\workspace\\native-image-maven-demo\\target\\demo-native-image-maven
--enable-monitoring=all
--native-image-info
--verbose

Here are the logs of the maven execution of the native image with --native-image-info and --verbose options :

[INFO] --- native-maven-plugin:0.10.2:compile-no-fork (build-native) @ demo-native-image-maven ---
[INFO] Found GraalVM installation from GRAALVM_HOME variable.
[INFO] Downloaded GraalVM reachability metadata repository from file:/D:/platformsg2_R_64/.m2/repository/org/graalvm/buildtools/graalvm-reachability-metadata/0.10.2/graalvm-reachability-metadata-0.10.2-repository.zip
[INFO] Executing: D:\platform_java21\graalvm-community-jdk-22.0.2_windows-x64_bin\bin\native-image.cmd @target\tmp\native-image-6483500328482094922.args demo.nativeimage.Main
Apply jar:file:///D:/platform_java21/graalvm-community-jdk-22.0.2_windows-x64_bin/lib/svm/library-support.jar!/META-INF/native-image/com.oracle.svm/thirdparty/native-image.properties
Apply jar:file:///D:/platform_java21/graalvm-community-jdk-22.0.2_windows-x64_bin/lib/svm/library-support.jar!/META-INF/native-image/com.oracle.svm/polyglot/native-image.properties
Executing [
'INCLUDE=D:\VisualStudio\2022\Community\VC\Tools\MSVC\14.38.33130\include;D:\VisualStudio\2022\Community\VC\Tools\MSVC\14.38.33130\ATLMFC\include;D:\VisualStudio\2022\Community\VC\Auxiliary\VS\include;D:\Windows Kits\10\include\10.0.22621.0\ucrt;D:\Windows Kits\10\\include\10.0.22621.0\\um;D:\Windows Kits\10\\include\10.0.22621.0\\shared;D:\Windows Kits\10\\include\10.0.22621.0\\winrt;D:\Windows Kits\10\\include\10.0.22621.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um' \
'LIB=D:\VisualStudio\2022\Community\VC\Tools\MSVC\14.38.33130\ATLMFC\lib\x64;D:\VisualStudio\2022\Community\VC\Tools\MSVC\14.38.33130\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;D:\Windows Kits\10\lib\10.0.22621.0\ucrt\x64;D:\Windows Kits\10\\lib\10.0.22621.0\\um\x64' \
'Path=D:\VisualStudio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64;D:\VisualStudio\2022\Community\Common7\IDE\VC\VCPackages;D:\VisualStudio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;D:\VisualStudio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;D:\VisualStudio\2022\Community\MSBuild\Current\bin\Roslyn;D:\VisualStudio\2022\Community\Team Tools\Performance Tools\x64;D:\VisualStudio\2022\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;D:\VisualStudio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;D:\VisualStudio\2022\Community\Team Tools\DiagnosticsHub\Collector;D:\Windows Kits\10\bin\10.0.22621.0\\x64;D:\Windows Kits\10\bin\\x64;D:\VisualStudio\2022\Community\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;D:\VisualStudio\2022\Community\Common7\IDE\;D:\VisualStudio\2022\Community\Common7\Tools\;D:\platform_java21\graalvm-community-jdk-22.0.2_windows-x64_bin\bin;D:\platform_java21\jdk-22.0.2+9\bin;D:\platform_java21\apache-maven-3.8.8\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\TortoiseSVN\bin;D:\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\TortoiseGit\bin;C:\Program Files\dotnet\;%NVM_HOME%;%NVM_SYMLINK%;G:\TS\COM32;G:\TS\NSDK32_5.0;C:\Program Files (x86)\CVSNT\;C:\Users\c82ncaz\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\c82ncaz\AppData\Local\Programs\Fiddler;C:\Users\c82ncaz\.dotnet\tools;C:\Users\c82ncaz\AppData\Roaming\nvm;C:\Program Files\nodejs ;D:\VisualStudio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;D:\VisualStudio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;D:\VisualStudio\2022\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe;D:\VisualStudio\2022\Community\VC\vcpkg' \
'TEMP=C:\TEMP' \
USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM=true \
'D:\platform_java21\graalvm-community-jdk-22.0.2_windows-x64_bin\bin\java.exe' \
-XX:+UseParallelGC \
-XX:+UnlockExperimentalVMOptions \
-XX:+EnableJVMCI \
-Dtruffle.TrustAllTruffleRuntimeProviders=true \
-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime \
-Dgraalvm.ForcePolyglotInvalid=true \
-Dgraalvm.locatorDisabled=true \
--add-exports=java.base/com.sun.crypto.provider=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.access=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.event=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.loader=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.logger=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.misc=org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile,org.graalvm.nativeimage.pointsto \
--add-exports=java.base/jdk.internal.module=org.graalvm.nativeimage.base,org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.org.objectweb.asm=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.perf=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.platform=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.ref=org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile \
--add-exports=java.base/jdk.internal.reflect=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.util=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.vm.annotation=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.vm=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.invoke.util=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.net.www=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.net=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.nio.ch=org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile \
--add-exports=java.base/sun.reflect.annotation=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.factory=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.reflectiveObjects=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.repository=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.scope=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.tree=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.jca=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.provider=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.ssl=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.util=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.x509=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.text.spi=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.calendar=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.cldr=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.locale.provider=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.locale=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.resources=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util=org.graalvm.nativeimage.builder \
--add-exports=java.management/com.sun.jmx.mbeanserver=org.graalvm.nativeimage.builder \
--add-exports=java.management/sun.management=org.graalvm.nativeimage.builder,org.graalvm.nativeimage.pointsto \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.graal.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.graal.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code.site=jdk.graal.compiler,org.graalvm.nativeimage.builder \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code.stack=jdk.graal.compiler,org.graalvm.nativeimage.builder \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code=jdk.graal.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile,org.graalvm.nativeimage.pointsto,org.graalvm.truffle.compiler \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.common=jdk.graal.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.pointsto \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=jdk.graal.compiler \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=jdk.graal.compiler \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.riscv64=jdk.graal.compiler \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot=jdk.graal.compiler,org.graalvm.nativeimage.builder \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.meta=jdk.graal.compiler,org.graalvm.nativeimage.base,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile,org.graalvm.nativeimage.pointsto,org.graalvm.truffle.compiler \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.riscv64=jdk.graal.compiler,org.graalvm.nativeimage.builder \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.runtime=jdk.graal.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.pointsto \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.services=jdk.graal.compiler,org.graalvm.nativeimage.builder \
--add-exports=jdk.jfr/jdk.jfr.events=org.graalvm.nativeimage.builder \
--add-exports=jdk.jfr/jdk.jfr.internal.event=org.graalvm.nativeimage.builder \
--add-exports=jdk.jfr/jdk.jfr.internal.jfc=org.graalvm.nativeimage.builder \
--add-exports=jdk.jfr/jdk.jfr.internal=org.graalvm.nativeimage.builder \
--add-exports=jdk.management/com.sun.management.internal=org.graalvm.nativeimage.builder \
-XX:+UseJVMCINativeLibrary \
-Xss10m \
-XX:MaxRAMPercentage=63.52123237364978 \
-XX:GCTimeRatio=9 \
-XX:+ExitOnOutOfMemoryError \
-Djava.awt.headless=true \
'-Dorg.graalvm.vendor=GraalVM Community' \
-Dorg.graalvm.vendorurl=https://www.graalvm.org/ \
'-Dorg.graalvm.vendorversion=GraalVM CE 22.0.2+9.1' \
-Dorg.graalvm.version=24.0.2 \
-Dcom.oracle.graalvm.isaot=true \
-Djava.system.class.loader=com.oracle.svm.hosted.NativeImageSystemClassLoader \
-Xshare:off \
-Djdk.reflect.useOldSerializableConstructor=true \
-Djdk.internal.lambda.disableEagerInitialization=true \
-Djdk.internal.lambda.eagerlyInitialize=false \
-Djava.lang.invoke.InnerClassLambdaMetafactory.initializeLambdas=false \
-Djava.lang.invoke.MethodHandle.DONT_INLINE_THRESHOLD=-1 \
-Djava.lang.invoke.MethodHandle.PROFILE_GWT=false \
--add-modules=ALL-DEFAULT \
--module-path \
'D:\platform_java21\graalvm-community-jdk-22.0.2_windows-x64_bin\lib\svm\builder\native-image-base.jar;D:\platform_java21\graalvm-community-jdk-22.0.2_windows-x64_bin\lib\svm\builder\objectfile.jar;D:\platform_java21\graalvm-community-jdk-22.0.2_windows-x64_bin\lib\svm\builder\pointsto.jar;D:\platform_java21\graalvm-community-jdk-22.0.2_windows-x64_bin\lib\svm\builder\svm-foreign.jar;D:\platform_java21\graalvm-community-jdk-22.0.2_windows-x64_bin\lib\svm\builder\svm.jar' \
--module \
org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner \
-keepalive \
'C:\TEMP\.native_image3307602746633341972alive' \
-imagecp \
'D:\platform_java21\workspace\native-image-maven-demo\target\demo-native-image-maven-1.0-SNAPSHOT.jar' \
-imagemp \
'D:\platform_java21\graalvm-community-jdk-22.0.2_windows-x64_bin\lib\svm\library-support.jar' \
'-H:CLibraryPath=D:\platform_java21\graalvm-community-jdk-22.0.2_windows-x64_bin\lib\svm\clibraries\windows-amd64' \
'-H:Path@driver=D:\platform_java21\workspace\native-image-maven-demo\target' \
-H:FallbackThreshold@user+api=0 \
-H:Name@user+api=demo-native-image-maven \
-H:EnableMonitoringFeatures@user+api=all \
-H:+DumpTargetInfo@user+api \
'-H:Class@explicit main-class=demo.nativeimage.Main' \
-H:ImageBuildID@driver=bd9b4c88-e250-f939-08fc-65be7da1c8dc \
'-H:Features@jar:file:///D:/platform_java21/graalvm-community-jdk-22.0.2_windows-x64_bin/lib/svm/library-support.jar!/META-INF/native-image/com.oracle.svm/thirdparty/native-image.properties+api=com.oracle.svm.thirdparty.gson.GsonFeature' \
'-H:Features@jar:file:///D:/platform_java21/graalvm-community-jdk-22.0.2_windows-x64_bin/lib/svm/library-support.jar!/META-INF/native-image/com.oracle.svm/polyglot/native-image.properties+api=com.oracle.svm.polyglot.groovy.GroovyIndyInterfaceFeature,com.oracle.svm.polyglot.scala.ScalaFeature'
]
========================================================================================================================
GraalVM Native Image: Generating 'demo-native-image-maven' (executable)...
========================================================================================================================
For detailed information and explanations on the build output, visit:
https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md
------------------------------------------------------------------------------------------------------------------------
[1/8] Initializing...                                                                                   (36,9s @ 0,18GB)
 Java version: 22.0.2+9, vendor version: GraalVM CE 22.0.2+9.1
 Graal compiler: optimization level: 2, target machine: x86-64-v3
 C compiler: cl.exe (microsoft, x64, 19.38.33135)
 Garbage collector: Serial GC (max heap size: 80% of RAM)
 1 user-specific feature(s):
 - com.oracle.svm.thirdparty.gson.GsonFeature
------------------------------------------------------------------------------------------------------------------------
Build resources:
 - 22,41GB of memory (56,5% of 39,68GB system memory, determined at start)
 - 12 thread(s) (100,0% of 12 available processor(s), determined at start)
# Printing compilation-target information to: D:\platform_java21\workspace\native-image-maven-demo\target\reports\target_info_20240826_101810.txt
# Printing native-library information to: D:\platform_java21\workspace\native-image-maven-demo\target\reports\native_library_info_20240826_101819.txt
[2/8] Performing analysis...  [****]                                                                     (9,2s @ 0,29GB)
    3?176 reachable types   (72,1% of    4?404 total)
    3?683 reachable fields  (42,8% of    8?615 total)
   14?808 reachable methods (44,1% of   33?544 total)
    1?058 types,    53 fields, and   545 methods registered for reflection
       61 types,    51 fields, and    52 methods registered for JNI access
        1 native library: version
[3/8] Building universe...                                                                               (1,7s @ 0,36GB)
[4/8] Parsing methods...      [*]                                                                        (0,9s @ 0,36GB)
[5/8] Inlining methods...     [***]                                                                      (0,9s @ 0,36GB)
[6/8] Compiling methods...    [***]                                                                      (9,0s @ 0,31GB)
[7/8] Laying out methods...   [*]                                                                        (1,0s @ 0,35GB)
[8/8] Creating image...       [*]                                                                        (1,5s @ 0,42GB)
   5,13MB (40,39%) for code area:     8?397 compilation units
   7,40MB (58,33%) for image heap:   90?214 objects and 75 resources
 167,08kB ( 1,29%) for other data
  12,69MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 origins of code area:                                Top 10 object types in image heap:
   3,77MB java.base                                            1,51MB byte[] for code metadata
 978,00kB svm.jar (Native Image)                               1,21MB byte[] for java.lang.String
 114,75kB java.logging                                       909,78kB java.lang.String
  65,55kB org.graalvm.nativeimage.base                       753,09kB java.lang.Class
  45,84kB jdk.proxy3                                         382,63kB heap alignment
  44,42kB jdk.proxy1                                         347,69kB byte[] for general heap data
  27,00kB jdk.internal.vm.ci                                 272,94kB com.oracle.svm.core.hub.DynamicHubCompanion
  22,68kB org.graalvm.collections                            244,31kB java.util.HashMap$Node
  11,42kB jdk.proxy2                                         196,05kB java.lang.Object[]
   8,18kB jdk.graal.compiler                                 180,05kB java.lang.String[]
   4,68kB for 3 more packages                                  1,47MB for 883 more object types
------------------------------------------------------------------------------------------------------------------------
Recommendations:
 HEAP: Set max heap for improved and more predictable memory usage.
 CPU:  Enable more CPU features with '-march=native' for improved performance.
------------------------------------------------------------------------------------------------------------------------
                        1,4s (2,2% of total time) in 171 GCs | Peak RSS: 0,81GB | CPU load: 3,95
------------------------------------------------------------------------------------------------------------------------
Build artifacts:
 D:\platform_java21\workspace\native-image-maven-demo\target\demo-native-image-maven.exe (executable)
========================================================================================================================
Finished generating 'demo-native-image-maven' in 1m 2s.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
selhagani commented 2 weeks ago

Hi @cnico,

Thank you for sharing this with us. I tested on my end and I confirm the issue you're facing. We will take a look into this and I'll keep you updated

selhagani commented 2 weeks ago

Hi @cnico,

Could you please try to test while using this option -H:ThrowMissingRegistrationErrors= to your native image build command and share your findings with me?

Here's an Example Command:

native-image -H:ThrowMissingRegistrationErrors= -jar your-app.jar

cnico commented 2 weeks ago

Hi @selhagani, I have added this option to the build and I see it is correctly taken into account by the maven build logs. The native executable is correctly generated without error. When I start the exe, it works without error or warning on the console and I still can not attach the process in visualvm. I added it to the github project that helps reproducing the problem in case you want to have a look at it : https://github.com/cnico/native-image-maven-demo

selhagani commented 2 weeks ago

Could you please share with me the logs now that you added that option for the newly built native image? thank you!

cnico commented 2 weeks ago

The logs at build time are :

...
========================================================================================================================
GraalVM Native Image: Generating 'demo-native-image-maven' (executable)...
========================================================================================================================
For detailed information and explanations on the build output, visit:
https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md
------------------------------------------------------------------------------------------------------------------------
[1/8] Initializing...                                                                                   (40,4s @ 0,18GB)
 Java version: 22.0.2+9, vendor version: GraalVM CE 22.0.2+9.1
 Graal compiler: optimization level: 2, target machine: x86-64-v3
 C compiler: cl.exe (microsoft, x64, 19.38.33135)
 Garbage collector: Serial GC (max heap size: 80% of RAM)
 1 user-specific feature(s):
 - com.oracle.svm.thirdparty.gson.GsonFeature
------------------------------------------------------------------------------------------------------------------------
 1 experimental option(s) unlocked:
 - '-H:ThrowMissingRegistrationErrors': This can happen on reflection and serialization queries, and resource access. (origin(s): command line)
------------------------------------------------------------------------------------------------------------------------
Build resources:
 - 20,88GB of memory (52,6% of 39,68GB system memory, determined at start)
 - 12 thread(s) (100,0% of 12 available processor(s), determined at start)
# Printing compilation-target information to: D:\platform_java21\workspace\native-image-maven-demo\target\reports\target_info_20240828_135049.txt
# Printing native-library information to: D:\platform_java21\workspace\native-image-maven-demo\target\reports\native_library_info_20240828_135057.txt
[2/8] Performing analysis...  [*****]                                                                    (8,0s @ 0,28GB)
    3?177 reachable types   (72,2% of    4?400 total)
    3?686 reachable fields  (42,8% of    8?615 total)
   14?815 reachable methods (44,2% of   33?534 total)
    1?058 types,    53 fields, and   545 methods registered for reflection
       61 types,    51 fields, and    52 methods registered for JNI access
        1 native library: version
[3/8] Building universe...                                                                               (1,4s @ 0,29GB)
[4/8] Parsing methods...      [*]                                                                        (0,8s @ 0,31GB)
[5/8] Inlining methods...     [***]                                                                      (0,7s @ 0,33GB)
[6/8] Compiling methods...    [***]                                                                      (8,2s @ 0,30GB)
[7/8] Laying out methods...   [*]                                                                        (1,0s @ 0,35GB)
[8/8] Creating image...       [*]                                                                        (1,3s @ 0,43GB)
   5,13MB (40,41%) for code area:     8?401 compilation units
   7,41MB (58,30%) for image heap:   90?255 objects and 75 resources
 167,95kB ( 1,29%) for other data
  12,70MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 origins of code area:                                Top 10 object types in image heap:
   3,77MB java.base                                            1,52MB byte[] for code metadata
 983,86kB svm.jar (Native Image)                               1,21MB byte[] for java.lang.String
 114,75kB java.logging                                       910,38kB java.lang.String
  65,55kB org.graalvm.nativeimage.base                       753,29kB java.lang.Class
  45,84kB jdk.proxy3                                         383,88kB heap alignment
  44,42kB jdk.proxy1                                         347,78kB byte[] for general heap data
  27,00kB jdk.internal.vm.ci                                 273,02kB com.oracle.svm.core.hub.DynamicHubCompanion
  22,68kB org.graalvm.collections                            244,31kB java.util.HashMap$Node
  11,42kB jdk.proxy2                                         196,05kB java.lang.Object[]
   8,18kB jdk.graal.compiler                                 180,16kB java.lang.String[]
   4,68kB for 3 more packages                                  1,47MB for 883 more object types
------------------------------------------------------------------------------------------------------------------------
Recommendations:
 HEAP: Set max heap for improved and more predictable memory usage.
 CPU:  Enable more CPU features with '-march=native' for improved performance.
------------------------------------------------------------------------------------------------------------------------
                        1,3s (2,0% of total time) in 176 GCs | Peak RSS: 0,82GB | CPU load: 3,40
------------------------------------------------------------------------------------------------------------------------
Build artifacts:
 D:\platform_java21\workspace\native-image-maven-demo\target\demo-native-image-maven.exe (executable)
========================================================================================================================
Finished generating 'demo-native-image-maven' in 1m 2s.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

And there is no log à runtime for the exe : I have just the System.out.print of my Java main :

D:\platform_java21\workspace\native-image-maven-demo>target\demo-native-image-maven.exe
Starting to compute prime numbers :)
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
...

and so on to the end of the program.

cnico commented 16 hours ago

Hi, Do you have any news on this ticket?