Skip to content

Commit 8b96aa9

Browse files
authored
Merge pull request #45217 from geoand/startup-profiling
Add tip about startup profiling
2 parents 8e1cfe5 + 4506a5e commit 8b96aa9

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

TROUBLESHOOTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,31 @@ Stop the application with `CTRL+C` once you have gathered what you want (e.g. ju
133133
It will dump the profiling information.
134134
The name of the file is in the `file=` parameter.
135135

136+
> [!TIP]
137+
> You can avoid needing to stop the application manually by writing a custom main that stops the application once it boots up
138+
>
139+
> ```java
140+
> import io.quarkus.runtime.Quarkus;
141+
> import io.quarkus.runtime.QuarkusApplication;
142+
> import io.quarkus.runtime.annotations.QuarkusMain;
143+
>
144+
> @QuarkusMain
145+
> public class Main {
146+
>
147+
> public static void main(String... args) {
148+
> Quarkus.run(MyApp.class, args);
149+
> }
150+
>
151+
> public static class MyApp implements QuarkusApplication {
152+
>
153+
> @Override
154+
> public int run(String... args) throws Exception {
155+
> return 0;
156+
> }
157+
> }
158+
> }
159+
```
160+
136161
For the allocation case, you obtain a JFR file, you can convert it to your typical Async Profiler flamegraph HTML output with:
137162

138163
```shell script

0 commit comments

Comments
 (0)