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.01k stars 1.6k forks source link

Issue in Finding native image packages and memory info from GraalVM dashboard tool #3081

Open bajajyog opened 3 years ago

bajajyog commented 3 years ago

Describe the issue I am using this GraalVM native image dashboard tool. https://www.graalvm.org/docs/tools/dashboard/. During native image generation, I provided all the required params and bgv file is generated. Size of bgv file is 5 GB. I am uploading the file to dashboard tool and it is erroring out due to large size of bgv file. Not able to tell what packages contained inside the native image. Please advise, how to resolve this issue? Is there a command line tool available by which I can know what packages are contained inside the native image. my native image size is 340 MB.

olyagpl commented 3 years ago

@bajajyog, first and foremost we should fix the dashboard tool. For now you can try -H:+PrintUniverse and grep to get the packages included into the native image.

bajajyog commented 3 years ago

Please fix the dashboard tool so that it can accept large bgv file. Thanks for this input-H:+PrintUniverse and let me try this.

oubidar-Abderrahim commented 3 years ago

Hi @bajajyog I am more interested in why the bgv file size is that big. Could you share a reproducer for this please?

bajajyog commented 3 years ago

This is good point that why bgv file size is 5GB? Here are the configs which I added in native-image properties file.

-H:DashboardDump=/tmp/dashboard/dashboard1 \ -H:+DashboardAll

Please advise these configs are good or not.

bajajyog commented 3 years ago

My use case is Spring Boot 2, Hibernate, Jersey, Log4j2, Redis, Gemfire microservice. I am creating a shaded jar whose size is 100 MB and building native image. Native image is deployed to AWS lambda.

oubidar-Abderrahim commented 3 years ago

I wonder, what is the size of the generated native-image?

bajajyog commented 3 years ago

Size of native image is 340 MB.

bajajyog commented 3 years ago

I generated native image with code and heap size params. BGV file size is only 38 MB now. Native image size is 340 MB. Please advise, how to reduce the size of native image. Attached BGV file. test.bgv.zip

bajajyog commented 3 years ago

Any recommendation to reduce the native image size from BGV file.

bajajyog commented 3 years ago

Any recommendation to reduce the native image size from BGV file.

Ondrej-Douda commented 3 years ago

Points-To Analysis generates a lot of data and its use should be avoided if not neccessary as Dashboard is limited by browser memory capabilities... Unfortunately I can't help with the image size...

bajajyog commented 3 years ago

My plan is to deploy native image in AWS lambda. AWS lambda allows max 256 MB of package size. My requirement is to reduce the size of native image from 340 MB to below 256 MB. I used UPX. With UPX, cold start time and memory are increased considerably.

fernando-valdez commented 6 months ago

@bajajyog, please let me know if this issue is still present in the latest GraalVM snapshot