@@ -19,15 +19,27 @@ redirect_from: /reference-manual/native-image/BuildOutput/
1919Here you will find information about the build output of GraalVM Native Image.
2020Below is the example output when building a native executable of the ` HelloWorld ` class:
2121
22+
23+ <!--
24+ To update the output below:
25+ $ cd substratevm-enterprise
26+ Ensure to set JAVA_HOME to a labsjdk-ee
27+ $ mx build
28+ $ (stty cols 80 && mx helloworld -g)
29+ Remove the `experimental option(s)` section
30+ Remove the `# Printing compilation-target` and `# Printing native-library` lines
31+ Replace the absolute paths at the end to start with `/home/janedoe/helloworld`
32+ -->
33+
2234```
2335================================================================================
2436GraalVM Native Image: Generating 'helloworld' (executable)...
2537================================================================================
26- [1/8] Initializing... (2.0s @ 0.19GB )
38+ [1/8] Initializing... (4.4s @ 0.29GiB )
2739 Builder configuration:
28- - Java version: 26+12 , vendor version: GraalVM CE 26-dev+12 .1
29- - Graal compiler: optimization level: 2, target machine: x86-64-v3
30- - C compiler: gcc (linux, x86_64, 15.2.1 )
40+ - Java version: 26+13 , vendor version: Oracle GraalVM 26-dev+13 .1
41+ - Graal compiler: optimization level: 2, target machine: x86-64-v3, PGO: ML-inferred
42+ - C compiler: gcc (linux, x86_64, 13.3.0 )
3143 - Assertions: enabled, system assertions: enabled
3244 - 1 user-specific feature(s):
3345 - com.oracle.svm.thirdparty.gson.GsonFeature
@@ -36,53 +48,61 @@ GraalVM Native Image: Generating 'helloworld' (executable)...
3648 - Assertions: disabled (class-specific config may apply), system assertions: disabled
3749--------------------------------------------------------------------------------
3850Build resources:
39- - 14.69GiB of memory (47 .0% of system memory, using all available memory )
40- - 20 thread(s) (100.0 % of 20 available processor(s), determined at start)
41- [2/8] Performing analysis... [******] (3.4s @ 0.40GB )
42- 3,297 types, 3,733 fields, and 15,247 methods found reachable
43- 1,066 types, 36 fields, and 415 methods registered for reflection
44- 58 types, 59 fields, and 52 methods registered for JNI access
45- 0 downcalls and 0 upcalls registered for foreign access
51+ - 30.00GiB of memory (48 .0% of system memory, capped at 30GiB )
52+ - 32 thread(s) (88.9 % of 36 available processor(s), determined at start)
53+ [2/8] Performing analysis... [******* ] (3.7s @ 0.58GiB )
54+ 2,140 types, 1,939 fields, and 8,997 methods found reachable
55+ 775 types, 35 fields, and 244 methods registered for reflection
56+ 49 types, 35 fields, and 48 methods registered for JNI access
57+ 52 resource accesses registered with 107B total size
4658 4 native libraries: dl, pthread, rt, z
47- [3/8] Building universe... (1.0s @ 0.60GB )
48- [4/8] Parsing methods... [*] (0.4s @ 0.62GB )
49- [5/8] Inlining methods... [**** ] (0.2s @ 0.59GB )
50- [6/8] Compiling methods... [**] (3.7s @ 0.66GB )
51- [7/8] Laying out methods... [*] (0.7s @ 0.60GB )
52- [8/8] Creating image... [**] (2.3s @ 0.65GB )
53- 5.24MB (21.86 %) for code area: 8,788 compilation units
54- 7.67MB (32.01 %) for image heap: 90,323 objects and 55 resources
55- 9.43MB (39.34 %) for debug info generated in 0.3s
56- 11.05MB (46.13 %) for other data
57- 23.96MB in total image size, 13.31MB in total file size
59+ [3/8] Building universe... (0.9s @ 0.74GiB )
60+ [4/8] Parsing methods... [*] (1.6s @ 0.72GiB )
61+ [5/8] Inlining methods... [***] (0.5s @ 0.66GiB )
62+ [6/8] Compiling methods... [*** ] (9.9s @ 0.81GiB )
63+ [7/8] Laying out methods... [*] (1.1s @ 0.67GiB )
64+ [8/8] Creating image... [**] (2.5s @ 0.90GiB )
65+ 2.86MiB (21.13 %) for code area: 4,078 compilation units
66+ 3.56MiB (26.33 %) for image heap: 63,478 objects and 1 resource
67+ 6.01MiB (44.40 %) for debug info generated in 0.4s
68+ 7.11MiB (52.55 %) for other data
69+ 13.53MiB in total image size, 6.88MiB in total file size
5870--------------------------------------------------------------------------------
5971Top 10 origins of code area: Top 10 object types in image heap:
60- 791.32kB java.base/java.util 1.41MB byte[] for code metadata
61- 363.66kB java.base/java.lang 1.21MB byte[] for string data
62- 323.39kB java.base/java.text 838.53kB java.base/java.lang.String
63- 241.87kB java.base/java.util.stream 633.02kB o.g.n.~e/c.o.s.c.h.Dyna~anion
64- 229.23kB java.base/java.util.regex 431.58kB heap alignment
65- 214.23kB java.base/java.util.concurrent 428.26kB java.base/java.lang.Class
66- 166.60kB o.g.n.~e/c.o.svm.core.code 323.23kB java.base/j.util.HashMap$Node
67- 153.78kB java.base/java.time.format 284.47kB byte[] for general heap data
68- 152.90kB java.base/java.math 232.06kB java.base/java.lang.Object[]
69- 142.02kB o.g.n.~e/c.o.s.c.genscavenge 183.10kB java.base/j.u.HashMap$Node[]
70- 2.32MB for 146 more packages 1.70MB for 966 more object types
72+ 342.94KiB java.base/java.util 820.99KiB byte[] for string data
73+ 289.94KiB java.base/java.lang 750.97KiB byte[] for code metadata
74+ 270.50KiB o.g.n.~e/c.o.svm.core.code 347.48KiB java.base/java.lang.String
75+ 189.67KiB o.g.n.~e/c.o.s.c.genscavenge 217.34KiB o.g.n.~e/c.o.s.c.h.Dyna~anion
76+ 129.09KiB java.base/j.util.concurrent 209.51KiB java.base/java.lang.Class
77+ 83.00KiB o.g.n.~e/c.o.s.c.j.functions 184.75KiB java.base/j.u.HashMap$Node
78+ 81.76KiB java.base/java.util.stream 115.53KiB java.base/char[]
79+ 76.73KiB o.g.n.~e/com.oracle.svm.core 107.66KiB java.base/j.i.u.SoftR~nceKey
80+ 60.32KiB o.g.n.~e/c.o.svm.core.thread 105.09KiB java.base/java.lang.Object[]
81+ 58.18KiB o.g.n.~e/c.o.svm.graal.stubs 88.63KiB java.base/j.u.c.Concu~p$Node
82+ 1.25MiB for 119 more packages 700.05KiB for 585 more object types
83+ Use '--emit build-report' to create a report with more details.
84+ --------------------------------------------------------------------------------
85+ Security report:
86+ - Binary includes Java deserialization.
87+ - CycloneDX SBOM with 5 component(s) is embedded in binary (406B). 6 type(s) could not be associated to a component.
88+ - Advanced obfuscation not enabled; enable with '-H:AdvancedObfuscation=""' (experimental support).
7189--------------------------------------------------------------------------------
7290Recommendations:
91+ G1GC: Use the G1 GC ('--gc=G1') for improved latency and throughput.
92+ PGO: Use Profile-Guided Optimizations ('--pgo') for improved throughput.
7393 FUTR: Use '--future-defaults=all' to prepare for future releases.
7494 HEAP: Set max heap for improved and more predictable memory usage.
7595 CPU: Enable more CPU features with '-march=native' for improved performance.
7696--------------------------------------------------------------------------------
77- 0.9s (6.1 % of total time) in 54 GCs | Peak RSS: 1.82GB | CPU load: 13.25
97+ 1.3s (4.8 % of total time) in 88 GCs | Peak RSS: 2.14GiB | CPU load: 18.03
7898--------------------------------------------------------------------------------
7999Build artifacts:
80100 /home/janedoe/helloworld/gdb-debughelpers.py (debug_info)
81101 /home/janedoe/helloworld/helloworld (executable)
82102 /home/janedoe/helloworld/helloworld.debug (debug_info)
83103 /home/janedoe/helloworld/sources (debug_info)
84104================================================================================
85- Finished generating 'helloworld' in 14.2s .
105+ Finished generating 'helloworld' in 25.5s .
86106```
87107
88108## Build Stages
@@ -160,9 +180,9 @@ The memory limit and number of threads used by the build process.
160180More precisely, the memory limit of the Java heap, so actual memory consumption can be higher.
161181Please check the [ peak RSS] ( #glossary-peak-rss ) reported at the end of the build to understand how much memory was actually used.
162182The actual memory consumption can also be lower than the limit set, as the GC only commits memory that it needs.
163- By default, the build process uses the dedicated mode (which uses 85% of system memory) in containers or CI environments (when the ` $CI ` environment variable is set to ` true ` ), but never more than 32GB of memory.
183+ By default, the build process uses the dedicated mode (which uses 85% of system memory) in containers or CI environments (when the ` $CI ` environment variable is set to ` true ` ), but never more than 30GiB of memory.
164184Otherwise, it uses shared mode, which uses the available memory to avoid memory pressure on developer machines.
165- If less than 8GB of memory are available, the build process falls back to the dedicated mode.
185+ If less than 8GiB of memory are available, the build process falls back to the dedicated mode.
166186Therefore, consider freeing up memory if your machine is slow during a build, for example, by closing applications that you do not need.
167187It is possible to override the default behavior and set relative or absolute memory limits, for example with ` -J-XX:MaxRAMPercentage=60.0 ` or ` -J-Xmx16g ` .
168188` Xms ` (for example, ` -J-Xms9g ` ) can also be used to ensure a minimum for the limit, if you know the image needs at least that much memory to build.
0 commit comments