You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference-manual/native-image/BuildOutput.md
+15-12Lines changed: 15 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,7 @@ Please report version and vendor when you [file issues](https://github.com/oracl
94
94
The selected optimization level and targeted machine type used by the Graal compiler.
95
95
The optimization level can be controlled with the `-O` option and defaults to `2`, which enables aggressive optimizations.
96
96
Use `-Ob` to enable quick build mode, which speeds up the [compilation stage](#stage-compiling).
97
-
This is useful during development to reduce image build time.
97
+
This is useful during development to reduce image build time.
98
98
Use `-Os` to optimize for size.
99
99
The targeted machine type can be selected with the `-march` option and defaults to `x86-64-v3` on AMD64 and `armv8-a` on AArch64.
100
100
See [here](#recommendation-cpu) for recommendations on how to use this option.
@@ -217,7 +217,7 @@ An origin is a group of Java sources and can be a JAR file, a package name, or a
217
217
The [`java.base` module](https://docs.oracle.com/en/java/javase/22/docs/api/java.base/module-summary.html), for example, contains base classes from the JDK.
218
218
The `svm.jar` file, the `org.graalvm.nativeimage.base` module, and similar origins contain internal sources for the Native Image runtime.
219
219
To reduce the size of the code area and with that, the total size of the native executable, re-evaluate the dependencies of your application based on the code area breakdown.
220
-
Some libraries and frameworks are better prepared for Native Image than others, and newer versions of a library or framework may improve (or worsen) their code footprint.
220
+
Some libraries and frameworks are better prepared for Native Image than others, and newer versions of a library or framework may improve (or worsen) their code footprint.
221
221
222
222
#### <aname="glossary-image-heap"></a>Image Heap
223
223
The heap contains reachable objects such as static application data, metadata, and `byte[]` for different purposes (see below).
@@ -267,19 +267,19 @@ This shows whether Java deserialization is included in the native executable or
267
267
If not included, the attack surface of the executable is reduced as the executable cannot be exploited with attacks based on Java deserialization.
268
268
269
269
#### <aname="glossary-sbom"></a><aname="glossary-embedded-sbom"></a>Software Bill of Material (SBOM)
270
-
This section indicates whether a SBOM was assembled and in what ways it was stored.
271
-
The storage formats include: `embed`, which embeds the SBOM in the binary; `classpath`, which saves the SBOM to the classpath; and `export`, which includes the SBOM as a JSON build artifact.
272
-
The SBOM feature is enabled by default and defaults to the `embed` option.
273
-
When embedded, the SBOM size is displayed.
274
-
The number of components is always displayed.
270
+
This section indicates whether an SBOM was assembled and in what ways it was stored.
271
+
The storage formats include: `embed`, which embeds the SBOM in the binary; `classpath`, which saves the SBOM to the classpath; and `export`, which includes the SBOM as a JSON build artifact.
272
+
The SBOM feature is enabled by default and defaults to the `embed` option.
273
+
When embedded, the SBOM size is displayed.
274
+
The number of components is always displayed.
275
275
The SBOM feature can be disabled with `--enable-sbom=false`.
276
276
277
277
Unassociated types are displayed when certain types (such as classes, interfaces, or annotations) cannot be linked to an SBOM component.
278
278
If these types contain vulnerabilities, SBOM scanning will not detect them.
279
279
To fix this, ensure that proper GAV coordinates (Group ID, Artifact ID, and Version) are defined in the project POM's properties or in _MANIFEST.MF_ using standard formats.
280
280
281
281
Use the [build report](BuildReport.md) to view included components, their dependencies, and any unassociated types.
282
-
For more information, see [Software Bill of Materials](../../security/native-image.md).
282
+
For more information, see [Software Bill of Materials (SBOM) in Native Image](../../security/SBOM.md).
This section indicates whether advanced obfuscation was applied.
@@ -296,8 +296,11 @@ Advanced obfuscation is applied to your application code and third-party depende
296
296
* Module and package names containing a class that loads a resource
297
297
* Names of annotations, lambdas, and proxies
298
298
299
-
To export a mapping from original to obfuscated names, use `-H:AdvancedObfuscation=export-mapping`.
300
-
See the [build report](BuildReport.md) for summary statistics, such as the percentage of class and method names that were obfuscated.
299
+
To export a mapping from original to obfuscated names, use `-H:AdvancedObfuscation=export-mapping`.
300
+
Use the mapping file and the `native-image-configure deobfuscate` command to deobfuscate stack traces.
301
+
See the [build report](BuildReport.md) for summary statistics, such as the percentage of class and method names that were obfuscated.
302
+
303
+
For more information, see [Advanced Obfuscation in Native Image](../../security/Obfuscation.md).
301
304
302
305
> Native Image obfuscates binaries by removing class files, applying aggressive optimizations, and eliminating dead code. The advanced obfuscation feature also obfuscates symbol names.
303
306
@@ -373,8 +376,8 @@ Note, however, that the overall peak throughput of the executable may be lower d
373
376
#### <aname="recommendation-init"></a>`INIT`: Use the Strict Image Heap Configuration
374
377
375
378
Start using `--strict-image-heap` to reduce the amount of configuration and prepare for future GraalVM releases where this will be the default.
376
-
This mode requires only the classes that are stored in the image heap to be marked with `--initialize-at-build-time`.
377
-
This effectively reduces the number of configuration entries necessary to achieve build-time initialization.
379
+
This mode requires only the classes that are stored in the image heap to be marked with `--initialize-at-build-time`.
380
+
This effectively reduces the number of configuration entries necessary to achieve build-time initialization.
378
381
When adopting the new mode it is best to start introducing build-time initialization from scratch.
379
382
During this process, it is best to select individual classes (as opposed to whole packages) for build time initialization.
380
383
Also, before migrating to the new flag make sure to update all framework dependencies to the latest versions as they might need to migrate too.
0 commit comments