Skip to content

Commit 8162cb4

Browse files
authored
Updating the script to upgrade to Async Profiler 4.1 (#331)
* Updating the script to upgrade to Async Profiler 4.1 * Updating support for Async Profiler 4.1 * Improving scripts * New tests with java 25
1 parent 76513fa commit 8162cb4

25 files changed

Lines changed: 15390 additions & 1938 deletions

.cursor/rules/161-java-profiling-detect.md

Lines changed: 992 additions & 237 deletions
Large diffs are not rendered by default.

.sdkmanrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
java=24.0.1-graalce
2-
maven=3.9.10
1+
java=25-amzn
2+
maven=3.9.10

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
## Goal
99

1010
The project provides a collection of `System prompts` for Java Enterprise development that help software engineers in their daily programming work.
11-
The [available System prompts for Java](./CURSOR-RULES-JAVA.md) cover aspects like `Build system based on Maven`, `Design`, `Coding`, `Testing`, `Refactoring & JMH Benchmarking`, `Performance testing with JMeter`, `Profiling with Async profiler/JDK tools`, `Documentation` & `Diagrams`.
11+
The [available System prompts for Java](./CURSOR-RULES-JAVA.md) cover aspects like `Build system based on Maven`, `Design`, `Coding`, `Testing`, `Refactoring & JMH Benchmarking`, `Performance testing with JMeter`, `Profiling with Async profiler/OpenJDK tools`, `Documentation` & `Diagrams`.
1212

1313
### Compatibility with Modern IDEs, CLI & Others
1414

examples/spring-boot-memory-leak-demo/README-DEV.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,43 @@
1-
# Essential Maven Goals:
1+
# Spring Boot Memory Leak Demo
2+
3+
## Controller Configuration
4+
5+
This demo includes two controllers that can be conditionally enabled based on the `coco` property:
6+
7+
- **CocoController**: Contains intentional memory leaks for demonstration purposes
8+
- **WithoutCocoController**: Proper implementation with resource management
9+
10+
### Configuration Options
11+
12+
Set the `coco` property in your application properties:
13+
14+
```properties
15+
# Enable CocoController (with memory leaks for demo purposes)
16+
coco=true
17+
18+
# Enable WithoutCocoController (proper resource management)
19+
coco=false
20+
```
21+
22+
### Profile-Specific Configuration
23+
24+
- **Default profile** (`application.properties`): `coco=true` (enables CocoController)
25+
- **Virtual Threads profile** (`application-vt.properties`): `coco=false` (enables WithoutCocoController)
26+
27+
### Usage Examples
28+
29+
```bash
30+
# Run with CocoController (memory leaks)
31+
./mvnw spring-boot:run
32+
33+
# Run with WithoutCocoController (proper resource management)
34+
./mvnw spring-boot:run -Dspring.profiles.active=vt
35+
36+
# Override property at runtime
37+
./mvnw spring-boot:run -Dcoco=false
38+
```
39+
40+
## Essential Maven Goals:
241

342
```bash
443
# Analyze dependencies
@@ -41,6 +80,29 @@ http://localhost:8080/swagger-ui/index.html
4180

4281
jwebserver -p 8005 -d "$(pwd)/examples/spring-boot-memory-leak-demo/profiler/results"
4382

83+
## Enhanced Profiling with Java 25 JFR Support
84+
85+
The profiler script has been enhanced with comprehensive Java 25 JFR support. See `profiler/JAVA25-JFR-FEATURES.md` for details.
86+
87+
### New Profiling Options (v4.2):
88+
- **Option 17**: Enhanced JFR Memory Profiling (Java 21+)
89+
- **Option 18**: Java 25 CPU-Time Profiling (Linux only)
90+
- **Option 19**: Java 25 Method Tracing
91+
- **Option 20**: Advanced JFR with Custom Events
92+
- **Option 21**: JFR Memory Leak Analysis with TLAB tracking
93+
94+
### Usage:
95+
```bash
96+
# Run the enhanced profiler
97+
./profiler/scripts/profile-java-process.sh
98+
99+
# Start the application first
100+
./mvnw spring-boot:run
101+
102+
# Then in another terminal, run the profiler and select from 21 options
103+
```
104+
105+
### Cursor Rules Integration:
44106
My Java application has performance issues - help me set up comprehensive profiling process using @151-java-profiling-detect.md and use the location examples/spring-boot-memory-leak-demo/profiler
45107

46108
Analyze the results located in examples/spring-boot-memory-leak-demo/profiler and use the cursor rule @152-java-profiling-analyze

0 commit comments

Comments
 (0)