Comments (5)
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
from graal.
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
from graal.
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
from graal.
Could you please share with me the logs now that you added that option for the newly built native image? thank you!
from graal.
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.
from graal.
Related Issues (20)
- Exception in thread "main" java.lang.IllegalArgumentException: invalid type parameter: void HOT 1
- [GR-57724] Using GraalVM with JBOSS/Wildfly throws warning: does not support runtime compilation HOT 11
- GraalVM Fatal error reported via JNI: Could not allocate library name HOT 2
- [GR-57252] Improve error message when trying to build static image on unsupported platforms
- NPE in com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntimeAccess.createRuntime(): "jdk.internal.module.Modules.JLA" is null HOT 1
- [Feature Request] Turn off truffle compilation dynamically
- [GR-57284] `JAVA_TOOL_OPTIONS` environment variable in native executables HOT 1
- JavaFX native image doesnt work on different cpu (both windows and 64 bit) HOT 1
- Provide graaljs that's useable across JDK versions 11 through 22 by backporting #7510 HOT 1
- Unable to use GDB to debug the actual value of variables in GraalVM Native Image HOT 1
- [GR-57347] Create a Snapcraft package for Ideal Graph Visualizer
- [GR-57624] [24.2] NPE in Locale processing with JDK 24+10 and better
- native-image build failed HOT 8
- Large quantities of virtual threads may cause JFR performance issues
- When using new Date() in JavaScript, if the system time is changed, the returned value is still the time before the modification HOT 1
- [GR-34103] Shutdown hooks not called when -H:-ParseRuntimeOptions is set HOT 3
- [GR-57707] native-image-agent omits String[] from "serialization" when using newConstructorForSerialization HOT 3
- Graal Initialization Failure - Intel i3 Processors 2nd Gen HOT 3
- [GR-57831] StringLatin1.charAt has a substantially supoptimal translation HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graal.