Skip to content

Commit

Permalink
add monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
alina-yur committed Feb 21, 2024
1 parent 4bd12ca commit f78d264
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set_command.sh
psrecord.py
default.iprof
.DS_Store
demo-monitored.hprof


### STS ###
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ There can be situations though when collecting profiles is not possible – for
If you are curious about the impact if this optimization, you can disable it with `-H:-MLProfileInference`. In our measurements, this optimization provides ~6% runtime performance improvement, which is pretty cool for an optimization you automatically get out of the box.


### G1 GC 🧹
## G1 GC 🧹

There could be different GC strategies. The default GC in Native Image, Serial GC, can be beneficial in certain scenarios, for example if you have a short-lived application or want to optimize memory usage.

Expand Down
34 changes: 25 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@

<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
Expand All @@ -48,6 +40,10 @@
</metadataRepository>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
Expand Down Expand Up @@ -98,9 +94,29 @@
<configuration>
<imageName>demo-optimized</imageName>
<buildArgs>
<buildArg>--gc=G1</buildArg>
<!-- <buildArg>- -gc=G1</buildArg> -->
<buildArg>--pgo=${project.basedir}/default.iprof</buildArg>
<buildArg>-march=native</buildArg>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>monitored</id>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<imageName>demo-monitored</imageName>
<buildArgs>
<!-- <buildArg>- -gc=G1</buildArg> -->
<buildArg>--pgo=${project.basedir}/default.iprof</buildArg>
<buildArg>-march=native</buildArg>
<buildArg>--enable-monitoring=heapdump,jfr,jvmstat</buildArg>
</buildArgs>
</configuration>
</plugin>
Expand Down

0 comments on commit f78d264

Please sign in to comment.